Overview
Let an OpenHands agent implement a change on its own branch, then have it present the important hunks one by one while you type them yourself to understand the code.
Problem or Objective
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Git
- Prerequisites
- OpenHands running locally, a git repository with tests, and access to a language model configured in OpenHands.
How It Works
Start OpenHands on your machine and open a conversation on your repository. Ask the agent to create a branch for itself, implement the feature there, run the tests and ask you before it commits. Then create your own branch from the starting point. Ask the agent to compare its branch with yours, sort the changed hunks by how much they matter, and leave out generated files, lockfiles and formatting-only edits. Have it show one important hunk at a time with a two-line explanation of why it is needed, and type that hunk yourself on your branch before asking for the next. When the important hunks are done, copy the remaining routine files across, run the tests on your branch, and ask the agent to compare both branches so you can see whether anything was missed or typed differently.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up OpenHands.
- Connect the toolsConnect the tools this workflow relies on: Git.
- Check the prerequisitesOpenHands running locally, a git repository with tests, and access to a language model configured in OpenHands.
- Gather your detailsCollect what the prompt asks for: Feature to implement, Branch for the agent, Your own branch.
- Run the starter promptPaste the starter prompt below into OpenHands and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at openhands.dev before you rely on it.
Practical Starter Prompt: Walk me through your changes one hunk at a time
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
Implement [Feature to implement] on a new branch named [Branch for the agent], run the tests, and ask me before you commit. Then compare [Branch for the agent] with my branch [Your own branch]. Sort the changed hunks by importance and leave out generated files, lockfiles and formatting-only edits, listing those separately. Show me one important hunk at a time with a two-line reason it is needed, and wait until I say done before showing the next. Do not edit [Your own branch] yourself.Approve the agent's commit only after you have seen the test results. You type every important hunk on your own branch yourself; the agent only shows and explains, and never edits your branch.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The OpenHands site describes an open source platform for software engineering agents with an interactive GUI and a CLI, and the README says it runs locally by default and keeps workspace files between sessions. No cited page describes walking through diffs or a learning mode, so how well the agent ranks hunks by importance depends on the model and the change, and the git steps are ordinary practice rather than an OpenHands feature.
Limitations and Considerations
Retyping is slow, so save it for changes you must understand well, such as security checks, data migrations or core logic. The agent can misjudge what matters: skim the skipped files list before you copy it across. Keep the agent's branch and your branch separate so a mistake in either can be thrown away. OpenHands works with a model you configure, which may need an API key and cost money per use. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Related Videos
About OpenHands/OpenHands
Setting up a CVE Remediation Factory with OpenHands (opens in a new tab)
Walkthrough of OpenHands by OpenHands: it is on the project’s own channel.
Watch on YouTube (opens in a new tab)About OpenHands/OpenHands
One AI Agent, Multiple LLMs: Automatic Model Routing in OpenHands (opens in a new tab)
Published by the project’s official channel.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- OpenHands (opens in a new tab)
Project documentation · openhands.dev · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- OpenHands is an open source platform for software engineering agents.
- Use the OpenHands GUI for interactive agent sessions.
- Use the CLI for terminal-native workflows.
- OpenHands/OpenHands README (opens in a new tab)
Project documentation · github.com · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- It runs locally on your machine by default, but can connect to multiple agent backends, for example agents in Docker containers, on VMs, or within your company infrastructure.

