Skip to content

OpenHands

An AI software engineer that writes, runs and fixes code in its own workspace, and can push branches and open pull requests on GitHub.

Best for
Building small apps and tools from a descriptionFixing bugs and GitHub issuesAdding tests and tidying codeExplaining a codebase you didn't writeReviewing pull requests on a schedule
Not for
Email, calendar or chat-app assistants (use OpenClaw or Hermes)Browsing websites for you (web browsing is turned off in deputyOS)Merging to production without a human review
Needs
6 GB memory and a 16 GB diskA strong AI model with tool use (a large online model, or a 30B+ coding model on your own computer)A GitHub token if it should push or open pull requests

Overview

OpenHands is an AI software engineer. You describe a job in plain words, such as “build a page that tracks my running distances” or “the tests are failing, find out why and fix it”. It plans the work, writes code, runs commands, reads the errors and tries again until the job is done. When it finishes, it tells you what it changed and why.

In deputyOS, OpenHands runs its Agent Canvas web app, which opens in the agent’s Canvas tab. Canvas is the control centre: you start conversations (one per task), follow every command and file edit the agent makes, browse and download its files, see its git changes and commits, and set up automations that run on a schedule. The agent works directly inside your deputyOS agent, a sealed computer of its own, so it can install tools and run code without touching your own files.

You can also send it a task from the agent’s Chat tab. There, each message is handled as its own task and the reply arrives in one piece when OpenHands has finished. For longer work you want to follow, correct as it goes, or continue later, use Canvas.

Key ideas

  • Conversation: one task with its own history, files and model. Start a new conversation for each separate job.
  • Workspace: the folder the agent works in. It can only read and change files inside the agent, never on your computer.
  • LLM profile: a saved model setup (service, model and key). deputyOS creates one called deputyos for you; you can add more in Settings > LLM and switch between them.
  • Secrets: keys and tokens you store in Settings > Secrets. The agent gets them as environment variables, for example a GITHUB_TOKEN for pushing code.
  • AGENTS.md: a file at the top of a code project that tells OpenHands how that project works (how to build it, run the tests, house rules). It is read at the start of every conversation.
  • Skills and MCP servers: skills add reusable instructions; MCP servers connect outside tools such as GitHub or Slack. Both live under Customize.
  • Automations: conversations that run by themselves on a schedule or when something happens, managed from Automate.

Set up

  1. Create the agent. Add an agent → OpenHands → Create. The first one downloads once. OpenHands needs about 6 GB of memory and a 16 GB disk, so close other agents first on a smaller computer.
  2. Connect an AI service. Open the agent’s Chat tab and follow the guided setup: choose your AI service and paste its API key, or choose Use AI on this computer. deputyOS saves this as an LLM profile called deputyos and makes it the default.
  3. Open Canvas. Open the agent’s Canvas tab. deputyOS has already chosen everything Canvas would ask on first use (the OpenHands agent, the local backend and your model), and turned off sending anonymous usage data to OpenHands, so it opens on its home screen.
  4. Check the model. In Canvas, open Settings > LLM. The deputyos profile should be listed and active.
  5. Try a small task. Go back to the home screen, start a conversation and send something quick with a visible result, such as the first prompt under Build an app. Watch the steps appear as it works.

Connect GitHub

OpenHands can clone public repositories without any setup. To clone private repositories, push branches and open pull requests, it needs a GitHub personal access token.

  1. On GitHub, open Settings → Developer settings → Personal access tokens and create a Fine-grained token.
  2. Choose Only select repositories and pick the repositories it may work on. Set an expiry date.
  3. Give it the smallest permissions that do the job: Metadata: Read-only, Contents: Read and write (to push branches) and Pull requests: Read and write (to open pull requests). Add Issues: Read and write only if it should comment on issues.
  4. Generate the token and copy it. GitHub shows it only once.
  5. In Canvas, open Settings > Secrets and choose Add a new secret. Name it GITHUB_TOKEN, paste the token as the value, add a short description, and choose Add secret.
  6. Start a new conversation. Secrets reach conversations that start after you save them.

If the agent needs a token in the middle of a task, it can also ask for one: a card titled The agent needs a secret appears in the conversation, and the value you type is saved without ever appearing in the chat.

For automations that watch GitHub, such as the pull request reviewer, also add the GitHub MCP server: Customize > MCP Servers, choose GitHub from the library, paste the token, leave the option to save it as a secret on, and save. Wait until its card says it is reachable.

Choose or change the model

OpenHands sends many requests per task and needs a model that is good at using tools. Its documentation recommends the strongest model you can afford for long or important work, and a cheaper one for routine edits.

  1. Open Settings > LLM in Canvas.
  2. Add a profile: the Basic tab for a service and model from the lists, or the Advanced tab to type a model name and address yourself.
  3. To reuse one API key for several profiles, save it once as a Provider Connection and link profiles to it.
  4. Set a profile as active to use it for new conversations, or switch during a conversation with the profile selector in the chat box or by typing /model (lists profiles) or /model <profile-name>.

The model recommendations are kept up to date by the OpenHands team from their own benchmark.

Teach it about your project

  1. Ask OpenHands to write an AGENTS.md for you (see the prompt below), read it, correct anything wrong, and commit it to the repository.
  2. To run setup steps every time it starts work on a repository (installing dependencies, for example), add a .openhands/setup.sh script.
  3. To install a ready-made skill, type /add-skill <github-url> in a conversation, then choose Start new conversation with this skill.

Please browse this repository, read its documentation and code, and create an AGENTS.md file at the root that summarizes: what the project is for, how to set it up and run it, how the folders are organized, and how to run the tests and linters. Keep it short.

Use cases

Build an app

Describe a small app or tool in plain words and get a working first version you can try and improve.

You’ll need:

  • The agent set up with a capable model.
  • A clear idea of what the app should do (one main job is best).

Steps:

  1. In Canvas, start a new conversation.
  2. Describe what you want: who it’s for, what it shows, what you can do with it. Mention the technology if you care (for example “plain HTML and JavaScript, no build step”).
  3. Follow the steps as it creates files and runs them. Expand a step to see the exact command or edit.
  4. When it reports it is done, open the conversation overview panel (the info control in the conversation header) and the Files tab to look at what it made. Use Download to save a file to your computer.
  5. Ask for changes in the same conversation: “make the chart weekly, not daily”. To try a different direction without losing the current one, use Branch from here on a message.

Build a single-page web app, plain HTML, CSS and JavaScript with no build step, where I can log my runs (date, distance in km, time) and see a bar chart of total distance per week. Save the data in the browser's local storage. Put everything in a folder called run-tracker and tell me how to open it.

Write a Python script that reads a CSV of bank transactions (date, description, amount), groups the spending by month and by category using simple keyword rules, and writes a summary CSV. Include a small sample CSV and run the script on it to show it works.

Fix a bug

Point OpenHands at a project, describe what’s wrong, and get a tested fix, pushed as a branch with a pull request if you like.

You’ll need:

  • The repository address. For private repositories, pushing and pull requests, a GitHub token (see Connect GitHub).
  • The error message, failing test or steps to reproduce the problem.

Steps:

  1. Start a new conversation in Canvas.
  2. Give it the repository and the problem. Paste the exact error message and say where it happens, if you know.
  3. Ask it to reproduce the problem first, then fix it, then run the tests.
  4. Review the change: open the overview panel and the Commits drawer to see uncommitted changes and commits side by side.
  5. When you are happy, ask it to push a branch and open a pull request. Read the pull request on GitHub before you merge it.

Clone https://github.com/<you>/<repo>. The contact form on the website doesn't send: clicking Send shows "500 Internal Server Error". Reproduce the problem, find the cause, fix it, and add a test that would have caught it. Run the whole test suite and tell me the result. Don't push anything yet.

The fix looks good. Create a branch called fix/contact-form, commit with a clear message, push it, and open a pull request that explains the cause and the fix.

Read issue #42 in https://github.com/<you>/<repo>, implement what it asks for on a new branch, run the tests, and open a pull request that references the issue.

Understand a codebase

Get a plain-language tour of a project you didn’t write, before you change anything.

You’ll need:

  • The repository address (and a token if it’s private).

Steps:

  1. Start a new conversation and ask it to clone the repository and explain it, without changing any files.
  2. Ask follow-up questions in the same conversation: where something happens, what a part does, what looks risky.
  3. To keep the explanation, ask it to write it to a Markdown file. Canvas shows Markdown files as a preview, and View opens the whole file.

Clone https://github.com/<owner>/<repo> and explain it to me without changing any files: what it does, how it is organized, how data flows from a request to the database, and how to run it locally. Finish with the three parts you think are most fragile.

Where in this code is the user's password checked at login? Show me the file and function, and explain step by step what happens.

Add tests and keep them passing

Have OpenHands add missing tests and keep working until they pass, without you checking in after every step.

You’ll need:

  • A project with a way to run tests (or ask it to set one up).
  • A model you trust for long tasks, and a spending limit with your AI service.

Steps:

  1. Open the project in a conversation.
  2. Use /goal to give it an objective it should keep working on. Add --max with a number of rounds to cap how long it tries.
  3. A banner shows the goal, the current round and what is still missing. Send a normal message at any time to interrupt and take back control.
  4. Review the new tests and the test run before you commit them.

/goal --max 3 add unit tests for the date parsing functions in src/utils/dates.py, covering empty input, time zones and invalid dates, and make sure the whole test suite passes

Look at the test coverage of this project, list the five most important functions that have no tests, and explain why each matters. Don't write any code yet.

Automations

Let OpenHands do recurring work by itself, such as reviewing new pull requests or writing a weekly summary of open issues.

You’ll need:

Steps:

  1. Open Automate in the left navigation.
  2. Under Start from a proven workflow, choose a ready-made one such as the GitHub pull request reviewer. Canvas opens a conversation with a prefilled prompt.
  3. Send it as it is, or add details first. The agent asks follow-up questions (which repository, which pull requests, how detailed the review should be) and then creates the automation.
  4. Back in Automate, open the automation, check that it is enabled and look at its runs. Every run is a normal conversation you can read and continue.

You can also ask for an automation in any conversation:

Create an automation that runs every Monday at 9:00 and summarizes the open issues and pull requests in <owner>/<repo>: what's new, what's stuck, and what needs my attention. Save the summary as a Markdown file.

With AI on your computer

Run OpenHands without an online AI service, using a coding model on your own computer: no key and no bill.

You’ll need:

  • A powerful computer. OpenHands’ own guide recommends Qwen3.6-35B-A3B as the first local model to try, which needs a GPU with 24 GB of video memory or an Apple Silicon Mac with 64 GB of memory.
  • LM Studio or Ollama, set up as described in Use AI on your own computer.

Steps:

  1. In the AI app, set the model’s context length to at least 22,000 tokens; 32,768 is recommended. Ollama’s default of 4,096 is far too small for OpenHands.
  2. In the agent’s Chat tab (for a new agent) or its Details tab (for an existing one), choose Use AI on this computer.
  3. Start a new conversation in Canvas with a small task to check that the agent actually runs commands and edits files.

Create a file called hello.py that prints today's date, run it, and show me the output.

Tips and limits

  • Your computer: when you give this agent computer access, deputyOS adds the computer to OpenHands’ MCP servers for new conversations.
  • Costs: a single task can make dozens of AI requests, and long tasks, goals and automations make many more. Set a spending limit with your AI service. The context meter in the chat box opens a Usage panel with token use for the conversation.
  • Model choice: use the strongest model you can afford for planning, debugging and reviews, and a cheaper profile for routine edits. Switch with /model without leaving the conversation.
  • Long conversations: when the context meter fills up, use Compact context, or start a new conversation with a short summary of where you are.
  • Good prompts are specific: name the file or feature, paste the exact error, and ask for one change at a time. “Make the code better” gives poor results.
  • It acts on its own computer: OpenHands runs real commands inside the agent. That keeps your computer safe, but anything you give it access to (tokens, repositories) it can change. Give tokens the fewest permissions and repositories that work. Settings > Verification controls approval behaviour.
  • No web browsing: in deputyOS the browser tool is turned off. OpenHands can still download packages and use GitHub and AI services.
  • Getting results out: download files from the Files tab, push them to GitHub, or use the Terminal tab. Conversation transcripts can be saved with Export transcript from the menu next to the conversation title.
  • Updates and backups: deputyOS updates OpenHands for you (Settings → Updates). Conversations, settings and saved keys are in the agent’s daily backups.
  • Keep it awake: the agent stops when your computer sleeps, which also pauses automations. See Sleep, hibernation and closing the lid.

Troubleshooting

Canvas is blank or says it can’t reach the backend

  1. OpenHands takes up to two minutes to start, longer after an update. Wait, then choose Reload.
  2. Check the agent is Running at the top of the agent. If it is Stopped, start it.
  3. If it still doesn’t load, restart the agent from the buttons at the top.

The conversation fails with a key or model error

  1. A warning banner about authentication usually means the AI service rejected the key or has run out of credit. Check your account with that service and add credit if needed.
  2. Connect the service again from the agent’s setup in Chat, or edit the profile in Settings > LLM. Canvas checks the key before it saves.
  3. An error like LLM Provider NOT provided or an unknown model means the model name doesn’t match the service. Pick the model from the Basic tab list instead of typing it.
  4. Start a new conversation: an existing one keeps the model it started with.

It answers like a chatbot and never edits files

The model isn’t good enough at using tools. Switch to a stronger profile with /model, or, with a local model, raise its context length to at least 22,000 tokens or use a larger model. See With AI on your computer.

It can’t push or open a pull request

  1. Check the token is saved in Settings > Secrets as GITHUB_TOKEN, then start a new conversation.
  2. Check on GitHub that the token hasn’t expired, includes this repository, and has Contents and Pull requests set to read and write.
  3. For an organization’s repositories, the organization may need to approve the token, or require single sign-on for it.

A message shows “Failed to send”

On a slow connection the message may still arrive; the bubble clears itself when it does. If it never arrives, choose Retry.

A tool I added under MCP Servers isn’t used

MCP servers and skills load when a conversation starts. Check the server’s card says it is reachable, then start a new conversation.

The agent is slow, stops, or runs out of memory or disk

  1. OpenHands needs at least 6 GB of memory. If the agent is short, Details → Performance suggests a better size with Apply and restart.
  2. Builds and dependencies fill the disk quickly. Check Details → Storage, ask OpenHands to delete old projects, or use This computer → Free up space.
  3. If it stopped overnight, the computer went to sleep. Keep it plugged in and awake.

Search the docs

The search index isn't built yet. Run npm run build to generate it (Pagefind writes to dist/pagefind/).