Claude Code, Codex, Pi, fx, OpenCode, Aider, Goose, and the rest do not share one codebase. They share a shape: a model inside an execution harness. The model proposes; the harness decides what reaches your machine.
# first: local agent does not mean local model
“Local” describes where the harness and its tools run. The agent can read your live worktree, execute your shell, reach a local database, and observe uncommitted changes. The model inference may still happen through OpenAI, Anthropic, Google, or another remote provider.
Some harnesses can point at a local model, but that is an independent decision. Treating runtime location and inference location as the same switch hides the most important security boundary in the system.
agent = model + context + tools + policy + runtime + proof
The model supplies judgment. Everything after it determines what that judgment can see, do, and safely return.
“The model determines capability. The harness determines how that capability touches reality.”
share this line
# the category is wider than five names
The useful split is not Claude versus Codex. It is the product opinion wrapped around the loop.
# the loop underneath all of them
Anthropic documents Claude's loop plainly: receive prompt, evaluate, call tools, feed results back, repeat, return a final result. OpenAI calls the reusable layer around that process the harness. Open-source agents expose variations of the same state machine directly in code.
prompt → decide → use a tool → observe → repeat → verify
- 01
assemble context— Load instructions, repository state, history, and available tools.
- 02
decide— The model chooses the next useful action.
- 03
check permission— The harness allows, asks about, or rejects that action.
- 04
execute— A tool reads a file, edits code, runs a command, or controls another system.
- 05
observe— The result returns to the model and changes the next decision.
- 06
verify— Tests, builds, and review decide whether the work is actually done.
The middle of the sequence loops; verification and handoff are what turn activity into useful work.
context = assemble(system, projectRules, history, repo, tools)
while (!done) {
response = model(context)
if (response.toolCalls.length === 0) break
for (const call of response.toolCalls) {
policy.check(call)
const result = sandbox.execute(call)
context.append(result)
}
context = compactIfNeeded(context)
}
return verifyAndSummarize(diff)The model never reaches into the filesystem by magic. It emits a structured request such as “read this file” or “run this command.” The harness validates the arguments, checks policy, performs the action, captures the result, and gives that observation back to the model. That mediation layer is where most of the engineering lives.
# seven decisions make harnesses feel different
Context assembly
Tool grammar
read/edit/bash toolkit is cheap and predictable. Browser, MCP, computer use, image tools, and deployment integrations expand capability while consuming context and authority.Permission boundary
Memory and compaction
Editing protocol
Orchestration
Observability
# five philosophies, not five winners
A ranking would be obsolete by the time it is indexed. The durable question is: which harness gives this task the right context, tools, boundaries, feedback speed, and proof?
# why I still want the agent beside the repo
- The working tree is honest. The agent sees the migration I have not committed, the local fixture I am debugging, and the exact branch state producing the bug.
- Steering is immediate. I can interrupt after one wrong assumption instead of receiving a polished implementation of the wrong architecture.
- Local systems are reachable. Databases, emulators, design files, browsers, device simulators, and proprietary tooling often exist only on the development machine.
- Taste loops stay tactile. Animation timing, spacing, loading states, accessibility, and interaction quality need a human looking at the product while it changes.
- The harness is composable. A terminal agent can call the same scripts, linters, test runners, and git tooling the team already trusts.
# the workflow that earns trust
The impressive workflow is not one giant prompt. It is a sequence that keeps intent, execution, and judgment separate enough to inspect.
- 01readMap the code before touching it.
- 02isolateOne task, one worktree, one owner.
- 03changeKeep the diff smaller than the task description.
- 04exerciseRun the product, not only the type checker.
- 05proveLint, tests, build, and a visual pass.
- 06reviewFresh context reads the final diff.
- 01Start in read-only mode. Ask for the request path, relevant files, existing conventions, risk surfaces, and verification commands.
- 02Write the acceptance criteria before the patch. If success cannot be observed, the agent cannot close the loop honestly.
- 03Give one owner the edit surface. Other agents may research or review, but simultaneous writers need separate worktrees and non-overlapping boundaries.
- 04Run the narrow check early. Exercise the changed component or failing test before paying for the full suite.
- 05Run the broad checks late. Lint, types, tests, production build, and product-level QA catch integration failures.
- 06Review from fresh context. A second pass reads the requirement and final diff without inheriting the builder's justifications.
# worktrees are an isolation primitive, not an org chart
Multiple local agents writing into one directory is a race condition with prose attached. Git worktrees give each task a branch and a filesystem boundary. They do not decide which agent owns the schema, shared component, or architectural choice.
main worktree human integration + final review
feature worktree one implementation owner
research session read-only; returns evidence
review session read-only; reads requirement + final diffdon't
Launch five agents into the same checkout because the tasks sound independent.
do
Partition by outcome and edit surface; give each writer an isolated worktree.
Concurrency is useful only when the merge cost stays lower than the time it saved.
# context is not memory
A large context window lets a model receive more tokens. It does not guarantee that the right evidence remains salient. Repository instructions, session history, tool schemas, search results, command output, images, and diffs all compete for attention.
# permissions are product design
The question is not whether an agent is “autonomous.” The useful question is which actions can happen without interruption, which need approval, and which should be impossible in this task.
read repository allow
search files allow
edit inside workspace allow after plan
run known test commands allow
network access task-specific
read secrets deny
destructive git always ask
publish / deploy / merge human approval# what I do not delegate
- The reason the product should exist. Agents can research alternatives; they cannot own the consequence of choosing one.
- Irreversible architecture under ambiguity. Database ownership, public contracts, security posture, and data deletion need accountable human judgment.
- Final visual taste. An agent can inspect, compare, and iterate. The decision that something feels coherent is still mine.
- Claims without sources. Especially in fast-moving agent markets, a plausible acquisition or feature is not a fact until the primary announcement supports it.
# the durable takeaway
Local agents are not valuable because the terminal looks serious. They are valuable because the harness can sit next to the real system: the live repository, the shell, the running product, and the human who still understands why the change matters.
Tool names will rotate. Companies will merge. Models will leapfrog one another. The stable architecture is the loop—and the craft is in designing its context, permissions, tools, memory, verification, and stopping conditions well enough that useful intelligence becomes trustworthy work.
# primary docs
- 01Claude Code — how the agent loop worksPrompt, model evaluation, tool execution, repeated turns, sessions, and compaction.
- 02Codex as a platformOpenAI's description of the harness, app server, tools, sandbox, approvals, and state.
- 03Pi documentationOfficial description of Pi's minimal core and extension surfaces.
- 04fxOfficial product page for the Zig harness, size, WASM support, and provider flexibility.
- 05OpenCode CLIOfficial description of its terminal clients, automation mode, and shared local service.
- 06Aider documentationGit-aware AI pair programming in the terminal.
- 07GooseOfficial open-source agent documentation covering CLI, desktop, API, and MCP.
- 08Gemini CLI to Antigravity CLI transitionOfficial Google repository announcement from May 2026.


