By September 2026 it is normal to have three AI coding agents open in the same terminal. Pi is an MIT-licensed harness that Mario Zechner started in August 2025. Claude Code is Anthropic’s official terminal agent. Codex CLI is OpenAI’s official harness and defaults to the GPT-5.6 line — Sol, Terra, and Luna. All three can edit files, run commands, and chase a red test. Many teams still ask which model is smarter. The better question is which harness you wrapped around the model: how many fixed tokens it injects every turn, which permissions it assumes, whether you can change vendors, and whether you pay a seat or you pay per finished task. This article skips public leaderboards. It answers a buying question: how to split code generation, bug fixing, token burn, model support, and development cost.
Why comparing models first is already the wrong 2026 decision
The old path and the new path collide in a concrete way. The old path is model-first: lock Opus, GPT-5.6, or a local weight, then bolt on whatever CLI is nearby. The new path is harness-first: decide whether you want a minimal auditable kernel, batteries-included guardrails, or default containment tied to one vendor. The same instruction — “make the failing test green” — produces different bills and different accidents because the harness decides how many bytes reach the model each turn, whether a sub-agent reloads the full system prompt, and whether a file write pauses for a human.
Three things made this a scheduling problem instead of a hobby comparison. First, mid-2026 internal studies started pairing the same model with different CLIs on private, already-merged changes that ship with tests. Public SWE-Bench and Terminal-Bench sets are easy to leak into training; a production suite is harder to game. Second, subscription insurance and metered API bills have forked. A Claude Code seat can be cheaper than sloppy API use, and Pi’s token advantage only counts if you were already paying per token. Third, default permissions differ by an order of magnitude. Pi inherits the launching user. Claude Code asks first. Codex leans into sandbox and policy. If you still shop by model score alone, you buy the invoice and the incident together.
There is also a local tax. Inference can live in the cloud while the CLI, the editor, language servers, a browser, and Docker still chew unified memory. RAM tiers are in the M6 Mac mini memory guide. Whether a node should host a resident agent is in Is the M6 Mac mini good for developers.
How to classify Pi, Claude Code, and Codex
Lining the three names up as peers guarantees a messy shortlist. Classify them by harness thickness. Drop one class and you are left with reputation.
| Class | Example | What you get | What you must add |
|---|---|---|---|
| Minimal and extensible | Pi | Read, write, edit, bash; a thin prompt; swap models | Plan mode, sub-agents, MCP, permission popups, a sandbox |
| Guarded out of the box | Claude Code | Plan, sub-agents, MCP, permission modes, checkpoints, many surfaces | Vendor freedom and tight per-task token control |
| Contained by default | Codex CLI | Plan mode, consistent sandbox policy, one account for ChatGPT and Codex Web | Model neutrality; the default line is OpenAI |
Pi is small on purpose: a coding-agent CLI, a multi-provider API, a TUI. Community traces of thick harnesses have shown system prompts in the twenty-thousand-token range plus long tool catalogs. Pi keeps the prompt near a thousand tokens and four built-in tools. That saves money and attention: tokens you do not send cannot dilute the middle of the context window. The docs are honest about the gap. There is no built-in plan mode, sub-agent manager, background bash, permission popup, MCP client, or todo list. Those are extensions or your orchestrator.
Claude Code takes the opposite bet. It encodes what to open when the request is vague, which commands to run before an edit, and when to stop and ask. If you do not yet keep an AGENTS.md, that insurance is the product, not waste. Do not mix a seat with an API key. Seat math is in Claude Code monthly cost for individuals.
Codex is not “another CLI that edits files.” It sells default containment and one account across the OpenAI door: CLI, IDE extension, Codex Web, desktop. The model ladder from Sol for hard open-ended work to Luna for high-throughput repeats fits teams already locked to ChatGPT and Codex. How a tool loop should be shaped is in What is Function Calling. Context windows and computer-use limits for the current flagship are in What is GPT-6 Astra.
Core comparison: entry, execution, context, audience
The real difference is the entry, not which lab published a higher score. Use one set of columns or you cannot decide.
| Tool | Entry | Execution | Context | Best for |
|---|---|---|---|---|
| Pi | Terminal CLI / TUI; many model backends | Read, write, edit, bash; the rest is an extension or your own loop | Thin system prompt; fewer files per turn; repo rules live in your tree | People who write clear specs, pay per token, and want to switch models or run local weights |
| Claude Code | Terminal, VS Code / JetBrains, desktop, browser | Edits, commands, plan mode, sub-agents, MCP | Thick prompt and tool catalog; fallback rules for fuzzy work | People who want guardrails, already pay a seat, and still write one-line prompts |
| Codex | CLI, IDE extension, Codex Web, desktop | Edits, commands, plan mode, policy-heavy sandboxing | OpenAI product context and sessions; default models on the GPT-5.6 ladder | People already in the OpenAI ecosystem who want containment and one login |
A second table adds only cost and permissions. The headers stay the same so the prose does not turn into empty adjectives.
| Tool | Entry | Execution | Context | Best for |
|---|---|---|---|---|
| Pi bill and rights | Your API key or gateway | No built-in permission popup; same rights as the launching user | Tokens go mostly to the task | People who will wrap a container and account per finished task |
| Claude Code bill and rights | Seat or API | Risky actions denied by default; several permission modes | The fixed prompt is present every turn; cache cuts price, not attention | People who want a predictable month and will not drop confirmations |
| Codex bill and rights | ChatGPT, API, or the cloud agent | Stronger default containment and consistent policy | Tied to OpenAI sessions and cloud review | People who rank safe defaults above vendor neutrality |
Code generation, bug fixes, tokens: what a fair test looks like
Do not accept a public exercise as the acceptance test. Answers to those problems live on the internet and may already sit in training. Pull changes from your own repo that already merged, ship with tests, and did not come from a bot. Use one generation task that fills a module the way the tree already does, one known failing test, and one regression whose file you do not name. Score only compile and the original suite. Do not hire another model as a judge.
# Same failing test, three CLIs — do not paste keys into the prompt pi --model anthropic/claude-opus-4-8 \ "Fix the failing test in auth_test.py and keep the public API stable." claude "Fix the failing test in auth_test.py and keep the public API stable." codex "Fix the failing test in auth_test.py and keep the public API stable." # After the run, record: tokens in/out, wall time, test pass/fail, files touched
On code generation, renaming an interface, filling a module from an existing pattern, or dropping boilerplate is usually cheaper in Pi. You already wrote the spec. The twenty-thousand-token fallback manual in a thick harness is a second copy of a document you maintain. Fuzzy work — “this path feels slow, take a look” — stays more stable in Claude Code or Codex because the harness fills in which files to read and which commands to run before an edit.
Bug fixes split on whether the location is known. If the test name and assertion already point at a function, Pi is enough. If the only signal is an intermittent 500 or a payment failure in one country, explore with a thick harness, lock the file, then hand the mechanical patch to Pi. Binding every job to “strongest model plus maximum effort” explodes the bill before it improves the suite.
Do not treat the sticker price per million tokens as development cost. Paired internal runs keep repeating the same finding: on the same model and the same task, Pi sends about a third as much content per turn as a thick harness. Longer tasks and more files make the gap compound. Teams have seen Opus at high effort land near two dollars per task in a vendor CLI and about half that in Pi, with pass rate within a couple of points. Twist effort to the maximum tier and Pi’s “send as little as possible” strategy can fall behind the model’s own long reasoning. Acceptance therefore must include the effort dial. One tier is not a study.
Sub-agents hide another leak. When a thick harness delegates, each child often reloads the full system prompt and tool list from zero. One measured task used about 121,000 tokens done directly and more than 500,000 after a split into two children. Parallelism you can see in the UI can be a four-times invoice. Subscription users who switch to Pi also start paying API meters. The “half-off” headline only holds if you were already on usage billing.
How to choose by scene
| If you are | Choose | Why |
|---|---|---|
| Able to name the file, the behavior, and the edge cases; the repo has AGENTS.md | Pi first | You already wrote the manual a thick harness would inject |
| Still sending “fix this”; almost no docs exist for an agent | Claude Code | You are buying fallback rules, not extra chrome |
| Already on ChatGPT / Codex and you rank safe defaults first | Codex | Containment and one account beat model neutrality |
| Need Claude, GPT, Gemini, or a local model in one CLI | Pi | The other two default to their own labs |
| Half mechanical interface work, half fuzzy bug hunts | Both: Pi plus Claude Code or Codex | Split by task; do not make them exclusive |
| Enterprise repo, production secrets, written audit rules | Codex or Claude Code plus a remote node; Pi only in a container | Same-user rights are a risk, not a convenience |
Recommended stacks
A — Solo developer on metered API: Pi is the primary path. Put a short agent-readable spec at the repo root: layout, test command, paths that must not change. Start on a high effort tier, not the maximum. Keep the laptop read-only for probes. Writes and bash go in a container or a remote Mac that isolates the session. Put the API invoice and the node rent on one sheet. Node rates are on Mac mini pricing.
B — Small product team with a Claude seat: Claude Code owns exploration, plans, and MCP connections. Renames, pattern-following fills, and already-red tests go to Pi. Run both for a week on the same three sample tasks. Compare tokens and rework, then pick a primary. Do not kill the cheaper path just to standardize the toolbar.
C — Enterprise or high security: Daily work stays on Codex or Claude Code permission modes. Pi appears only inside an audited image, with network and secrets issued per task. Sessions that write disk, open a browser, or touch a production replica belong on a disposable remote Mac, not the office laptop. Account and delivery limits are in the help center.
Common pitfalls
- Picking the harness by the model: “We use Opus, so we must use the official CLI.” Swap only the harness and both pass rate and cost-per-task move.
- Treating list price per million tokens as development cost: A cheaper model can burn more rounds. A thick prompt still occupies attention after a cache hit.
- Reading Pi’s default same-user rights as convenience: No popup is not the same as safe. Sandbox unfamiliar repos and secrets first.
- Pinning every job to maximum effort: A thin harness can lose at the top tier. Acceptance must include the dial.
- Splitting sub-agents for the sake of parallelism: Each child may reload the whole system prompt. The bill can beat the speedup.
Action plan: 7 steps
- Pick three samples from this repo: generate a slice in the existing style, fix one already-red test, and locate a regression without naming the file. Delete empty asks such as “make it better.”
- Run those three on the same model in Pi and in the vendor harness. Log input and output tokens, wall time, whether tests went green, and which files changed. Forbid the agent from reading git history that leaks the answer.
- Split work into mechanical fill-ins and fuzzy exploration. Default the first to Pi and the second to Claude Code or Codex. Write the ratio into a team note so nobody renegotiates it every morning.
- Write the billing path. Seat holders should not switch for a “half-off tokens” headline unless they already pay API. Metered users should table dollars per tested task, not the sticker.
- Pick an isolation for Pi: local container, micro-VM, or remote Mac node. Check permission modes and allowed MCP servers on the thick harness. Keys stay out of prompts and screenshots.
- Choose a primary harness by scene and allow a stack. Solo work can be Pi-first. A small team can explore in Claude Code and fill in Pi. Enterprises lock writes behind audited doors.
- Put execution on a reproducible Mac node: same image, same test command, workspace wiped at session end. A green run that only exists in a laptop cache is not acceptance.
FAQ
Which model is stronger: Pi, Claude Code, or Codex?
Wrong question. As of September 2026 all three can sit in front of a flagship model. Swap the harness on the same model and both pass rate and the bill move. Compare how context is fed, how permissions are gated, and whether you can change vendors.
If I already subscribe to Claude Code, should I still install Pi?
Yes, if you already pay API usage or have a lot of mechanical edits. The subscription buys insurance from a thick harness. Mechanical fill-ins, model switching, and token control still fit Pi. Run both for a week before you pick a primary path.
Does Codex only work with OpenAI models?
The default product line is GPT-5.6 Sol, Terra, and Luna. Its edge is containment plus one account across ChatGPT and Codex Web. If you need Claude, Gemini, or a local model in the same CLI, pick Pi.
Does a cheaper token price mean lower development cost?
No. Compare dollars per completed, tested task — not the sticker price per million tokens. A cheaper model can burn more rounds. A thick system prompt still occupies attention even when the cache hits.
Pi has no permission popups. Can I run it on my laptop?
It will run. Do not do that on an unfamiliar repo or production secrets. Pi’s docs say it inherits the launching user’s rights. Put it in a container or a remote Mac node before you enable writes and bash.
Conclusion
Picking an AI coding agent in 2026 is not a model-leaderboard errand. Pick the entry by harness thickness: Pi when the spec is clear and you need token control or model switching; Claude Code when prompts are still thin and you want plans and guardrails; Codex when you already live in OpenAI and want default containment. Split code generation and bug fixing by whether the location is known. Price the finished task, not the sticker. Set permissions from defaults, not from reputation. Write the three samples, the effort dial, and the reproducible node into acceptance. Remote nodes start on the rental page and the pricing page. Account questions go to the help center.
Further reading
- Claude Code monthly cost for individual developers →
- What is Function Calling: OpenAI, Gemini, Claude →
- What is GPT-6 Astra: pricing, context, and coding agents →
Agents that edit repos and run tests need an isolated Mac node
Pi inherits the launching user’s permissions. Claude Code and Codex also write files and spawn processes. That work should not share a daily laptop workspace. A remote Mac isolates the repo and secrets per session so “it ran once” can become “it can be retested.”