Every coding agent, whether Claude Code, Codex or the one I built, has two very different parts. The model is the brain: it reads code, plans and writes. On its own it can't touch a file, run a program or remember what happened five minutes ago. The harness is the body around it: what the model gets to see, which tools it can use, and how its work is checked.
Agent = model + harness. Swap the brain, keep the body.
I built kmare-code to understand the harness half properly. The most useful lesson was about checking.
The problem: the author is a bad reviewer
Ask a model to write code and then ask the same conversation whether the code is correct, and it will usually say yes. It has seen its own reasoning and is primed to agree with it. Early versions of my harness would cheerfully report "done" on code that didn't run.
Three roles instead of one
So kmare-code splits the work across three roles, each its own conversation:
- The planner turns the task into concrete steps and success criteria.
- The generator does the work with tools: read a file, write a file, run a command.
- The evaluator starts fresh. It sees the task, the plan and the result, never the generator's reasoning, and decides pass or fail with a reason.
A failure goes back to the generator with the evaluator's reason, and the loop runs again, up to a fixed number of rounds so a stuck task gives up instead of spending forever.
Guides before, sensors after
A harness steers the model at two moments. Guides act before: the system prompt for each role and the project's own rules file. Sensors act after: they check whether something actually worked. The best sensor isn't another model's opinion; it's reality. Give kmare-code a test command such as pytest -q and the evaluator runs it. A failing exit code fails the round immediately, without spending a model call on judging it.
Tools are the only hands
The model never touches your machine directly. It asks for a tool (read, write, run), and the harness decides whether to allow it. Writes and commands ask for approval unless you opt out. That one boundary makes the agent both safer and easier to debug, because every effect it had is in the tool log.
Any provider, same harness
Because the roles talk to a small common model interface, the same harness runs on Anthropic, OpenAI, Gemini, Ollama and others, plus an offline mock for tests. You can even mix them: a cheap model to generate and a stronger one to evaluate.
The headline lesson carries beyond coding agents. Whenever a model's output matters, have something other than the author check it, ideally something that runs the code rather than reads it.