Local coding agents
Agents go beyond autocomplete: they read a codebase, plan, and make changes across files. What they can do locally, how to run them safely, and where they still trip.
What you’ll learn
What a coding agent does that a plain assistant does not, how to run one against a local model, and how to do so without letting it loose on your machine unsupervised.
The concept
A coding agent takes a goal, rather than a single instruction, and works towards it: it reads files, plans a series of steps, edits across the codebase, runs commands, and checks results. This is a real step up in capability, and a real step up in what can go wrong, because you are handing a model access to your files and often your terminal.
Two ideas make agents workable:
- Plan then act. Tools like Cline propose a plan and let you approve each step, rather than charging ahead. Keeping a human in that loop is the main safeguard.
- Sandboxing. OpenHands runs tasks inside an isolated Docker container, so what the agent can touch is contained. Running agents in a sandbox, or at least a disposable branch, is strongly advisable.
Agents lean harder on the model than autocomplete does. They need strong tool use and a long context window to hold a codebase in view, so they benefit from a capable local model.
Doing it
- Use a model suited to agents. Devstral Small was built for agentic coding and pairs naturally with OpenHands; Qwen3-Coder 30B-A3B is a strong, longer-context alternative. Both want a 24GB card for comfortable use.
- Point the agent at your local model through Ollama or a compatible endpoint, so the whole loop stays on your machine.
- Start in a contained space. Work on a throwaway branch, or in a sandbox, so nothing the agent does is hard to undo.
- Supervise, especially early. Watch what it plans before you let it act, particularly anything that touches the terminal.
What can go wrong
- Unsupervised terminal access. An agent that can run commands can do real damage if it misfires. Approve steps, and sandbox the work.
- Confidently wrong changes. Agents can make plausible edits that quietly break things. Review the diff as you would a colleague’s pull request, because that is effectively what it is.
- Losing the thread on large codebases. Even with a long context, an agent can lose track across a big project. Scope tasks narrowly, and give it the relevant files rather than the whole repository.
- Expecting cloud-agent autonomy from a local model. The best cloud agents are more capable. A local agent is a genuine help on feature-sized tasks, not a hands-off replacement for you.
Next steps
If you have not yet, revisit choosing a local coding model to make sure your model is up to agentic work, and see the coding tools catalogue for the agents and their trade-offs.