pi vs Claude Code vs OpenCode: Picking Your Agentic CLI

TL;DR
pi vs Claude Code vs OpenCode vs Codex CLI: a verified capability matrix and pick-X-if verdicts for choosing your main agentic coding harness.
Last updated: October 23, 2026
Re-verified October 23, 2026. Three things moved since the August 23 check. pi shipped 1.0 on October 1 and is now at v1.4.0 (October 21), with built-in MCP, so its "refuses MCP" row below is corrected; see our Pi 1.0 release guide. OpenCode is on v1.19.4 (October 22) and now has a separate 2.x line. Codex CLI is at 0.164.0 (October 23). Star and fork counts were re-read from the GitHub API the same day. Pricing, plan and privacy rows were not re-checked in this pass, so treat them as of August 23.
This is part three of our pi series. Part one covered pi's minimal toolkit architecture and part two was a hands-on tour of run modes and session trees. Both ended the same way: fine, but would you make it your main agent? That question is only answerable against the incumbents. So this post compares pi against Claude Code, OpenCode, and Codex CLI on the things that decide a daily-driver choice: what each tool refuses to do, how far its model freedom goes, whether your subscription actually carries over, what it phones home, and what it costs when you lean on it hard.
Everything below was checked against official documentation, primary repositories, and the GitHub API on August 23, 2026. Where a capability is genuinely not documented anywhere official, the matrix says so rather than guessing.
Official Sources#
| Source | What it covers |
|---|---|
| earendil-works/pi and pi.dev docs | pi repository (MIT), coding-agent docs, providers, sessions |
| Claude Code overview and docs index | Claude Code capabilities across terminal, IDE, desktop, web |
| Claude plans and pricing | Pro $20, Max 5x $100, Max 20x $200, usage limits FAQ |
| Claude Code data usage | Training policy, retention, telemetry opt-outs |
| OpenCode docs and GitHub (anomalyco/opencode) | Install, providers, agents, MCP, SDK; MIT license |
| OpenCode Go and Zen | The $10/month subscription and pay-as-you-go marketplace |
| Codex models and GPT-5.6 announcement | GPT-5.6 Sol/Terra/Luna tiers, plan availability, pricing |
| GitHub API reads, August 23, 2026 | Star, fork, release and license counts for all four repos |
Where Each Harness Stands on August 23, 2026#
pi: the kit that refuses to be a product#
pi is an MIT-licensed TypeScript monorepo from Earendil holding roughly 117,400 stars and 15,000 forks as of October 23, 2026 (GitHub API), at version v1.4.0 released October 21, 2026. It was v0.84.2 when we first wrote this in August. Out of the box the model gets four tools (read, write, edit, bash), and the project's philosophy section explicitly refused, as of our August check, to build MCP support, sub-agents ("spawn pi instances via tmux"), permission popups, plan mode, built-in to-dos, and background bash. That list has aged: the v1.4.0 release notes mention mcp.json handling with pi mcp add and pi mcp remove, and codemode scripts and in-process subagents, so MCP is no longer a refusal (see the Pi 1.0 guide). We have not re-read the current philosophy section for the other items. Extensions, skills, and packages fill those gaps if you want them filled - our hands-on guide walks the mechanics. Its session format is the differentiator: JSONL files where every entry points at a parent, so /tree, /fork, and /clone navigate real branches of a conversation (session-format docs). The community's own taxonomy from the August 4 Hacker News thread holds up: "Codex, Claude Code are VS Code, JetBrains. Pi is Neovim" (HN).
Claude Code: the full product#
Claude Code is Anthropic's proprietary agent, shipped as a native binary plus VS Code, JetBrains, desktop, web, and mobile surfaces that all share one engine (overview). Its public GitHub repository shows 142,749 stars but carries no license file - the product itself is closed source (anthropics/claude-code). The orchestration stack is the deepest in the industry: subagents that run in the background by default and can spawn their own subagents (sub-agents, what's new week 24 and 27), agent teams with inter-agent messaging (agent teams), scriptable dynamic workflows (workflows), skills, plugins and marketplaces, hooks, MCP, cloud Routines, and an Agent SDK in TypeScript and Python (Agent SDK). Model coupling is total by design: you run Claude models (Fable, Opus 5, Sonnet 5, Haiku), and the enterprise routes through Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry change where inference runs, not whose models run (feature availability).
OpenCode: the open-source middle path#
OpenCode is MIT-licensed, built by Anomaly (the SST team), and now the largest open-source agent in the category: 220,549 stars and 29,491 forks as of October 23, 2026 (GitHub API), up from the 160,000 we recorded in June in our OpenCode developer guide. Latest release v1.19.4 landed October 22, 2026; OpenCode 2 now exists as a separate, explicit upgrade (opencode upgrade --major), per the release notes, and we cover it in our OpenCode 2 migration guide. It ships a TUI, desktop app, and IDE extension (docs), brings your own keys for 75+ providers, and layers first-party billing on top: Zen, a curated pay-per-token model marketplace with zero markups, and Go, a $10-per-month subscription ($5 the first month) targeting roughly 6x usage value with documented caps of $12 per five hours, $30 weekly, and $60 monthly. Plan mode and build mode are built in via Tab, sessions live locally, and the extension surface covers plugins, custom tools, commands, formatters, themes, LSP servers, and MCP (configure section).
Codex CLI: the fleet tool with fresh models#
Codex CLI is OpenAI's open-source Rust agent: Apache-2.0, 130,623 stars as of October 23, 2026 (GitHub API), latest release rust-v0.164.0 on October 23, 2026, covered in our 0.164 notes. It matters right now because of what it runs: the GPT-5.6 family went generally available on July 9, 2026 with three durable tiers - Sol for complex work, Terra as the everyday workhorse, Luna for high-volume tasks (models doc; announcement). Plan availability is tiered: Free and Go ChatGPT users get Terra only, while Plus, Pro, Business, and Enterprise choose among all three, including the max reasoning effort in Codex (announcement). Two August wrinkles worth knowing before you standardize: GPT-5.4 and gpt-5.3-codex are deprecated under ChatGPT sign-in with retirement at the end of August (migration guide), and the documented 1M-token context window is currently capped much lower inside Codex clients - Sol at 272K in the bundled catalog, a gap tracked and closed-without-fix in issue #38917, with follow-up reports putting Terra and Luna at 872K (issue #39144).
One more entrant deserves a sentence: Vercel's fx, a Zig-based "Unix like coding agent" created August 11, 2026, already at 2,225 stars (vercel-labs/fx). The minimalist-harness lane pi opened is now crowded enough that new builds target it explicitly. We have not tested fx and exclude it from the matrix.
Capability Matrix#
Every cell links or cites its basis. "Not documented" means we could not find official documentation as of August 23, 2026.
| Capability | pi | Claude Code | OpenCode | Codex CLI |
|---|---|---|---|---|
| License | MIT (repo) | Proprietary, no source license (repo) | MIT (repo) | Apache-2.0 (repo) |
| Stars, forks (Oct 23, 2026) | ~117,400 / 15,000 (API) | 153,154 / 26,731 on public repo (API) | 220,549 / 29,491 (API) | 130,623 / 20,601 (API) |
| Latest release | v1.4.0, Oct 21 (releases) | Native auto-updating channel; changelog (docs) | v1.19.4, Oct 22 (releases) | 0.164.0, Oct 23 (releases) |
| Install footprint | npm global package or curl installer; Node required (install docs) | Native installer, Homebrew, WinGet, npm; background auto-update (setup) | curl script, npm, Homebrew tap, choco/scoop/pacman, Docker (install) | npm package shipping a Rust binary (repo) |
| Model freedom | Widest: 3 subscription OAuth routes, ~30 API-key providers, local llama.cpp, mid-session switching with context handoff (providers) | Claude-family only; Bedrock/Vertex/Foundry change hosting, not vendor (model config) | BYO keys for 75+ providers; Zen marketplace; Go open-model subscription (providers) | GPT-5.6 family only under ChatGPT auth; Bedrock routing exists for enterprise (Bedrock guide) |
| Session branching/forking | Native design center: JSONL trees, /tree /fork /clone, branch summaries (session format) | Resume, branch and switch via /resume; checkpoint rewinds; fork mode default-on since mid-August (sessions, checkpointing, week 33) | Not documented; /undo and /redo revert code, not conversation shape (usage) | Headless resume supported; interactive tree navigation not documented (CLI) |
| Sub-agents | tmux, extensions, or packages like the Herdr family; v1.4.0 notes also mention in-process subagents via codemode (release); August philosophy position: none by design (philosophy) | Deepest stack: background subagents, nested subagents, agent teams, agent view, dynamic workflows, ultrareview (agents comparison) | Custom agent definitions with primary and subagent roles; plan/build modes built in (agents) | No interactive sub-agent UI documented in the CLI; multi-agent concurrency exists as an API beta (GPT-5.6) |
| MCP support | Built in since 1.0: v1.4.0 notes reference mcp.json and pi mcp add/pi mcp remove (release, our guide); it was a refusal in August (our analysis) | First-class client, channels reference, SDK tool search (MCP) | Documented MCP server configuration (MCP servers) | Configured via config.toml profile MCP overrides (migration guide) |
| Extensibility | TypeScript extensions via jiti, skills, prompts, themes, npm/git packages (extensions) | CLAUDE.md, Agent Skills, hooks, plugins and marketplaces, output styles, statusline (extend) | Plugins, custom tools, commands, formatters, themes, keybinds, LSP servers (configure) | config.toml profiles and AGENTS.md rules; thinner than the others (profiles guide) |
| Scripting/SDK surface | Four modes: print, JSON events, RPC over stdio, in-process TS SDK (SDK, RPC) | Headless claude -p, TypeScript and Python Agent SDK, deep links, HTTP hooks (headless) | opencode run CLI plus a server and SDK (SDK, server) | codex exec headless mode and config automation (Codex docs) |
| Subscription reuse | Yes, conditionally: ChatGPT Plus/Pro officially endorsed; Claude Pro/Max OAuth bills third-party harness use per token from extra usage, not plan limits (providers doc, our warning) | Its own subscription IS the product; Pro/Max pools shared with claude.ai chat and every surface (pricing FAQ) | Own billing only (Go/Zen); reuse of Claude or ChatGPT subscriptions not offered (Go docs) | ChatGPT plan IS the access tier: Free/Go get Terra; Plus and up get Sol/Terra/Luna (models) |
| Team features | Not documented; solo-project DNA, sharp-edged contribution governance (repo README) | Team/Enterprise plans, managed settings, analytics dashboard, gateway spend limits, ZDR (admin setup, analytics) | An Enterprise docs page covers organizational controls (enterprise) | Business and Enterprise plan tiers with workspace credits (plans) |
| Privacy and telemetry | Sessions are plain local JSONL you can parse yourself; no hosted analytics pipeline ships in the repo (session format, telemetry contracts) | Metrics on by default (DISABLE_TELEMETRY=1 opts out); error reports on for Pro/Max sign-ins v2.1.198+; consumer training toggle sets 5-year vs 30-day retention; plaintext local transcripts 30 days; WebFetch hostname preflight always runs (data usage) | Local SQLite sessions, sharing strictly opt-in via /share; Zen documents per-provider zero-retention deals, DeepSeek renewed monthly through August 31, 2026 (share, Go docs) | Governed by OpenAI terms under ChatGPT auth; not independently audited for this post; Bedrock route keeps prompts out of training (Bedrock guide) |
| Cost profile | Free harness, BYO tokens; measured among the cheapest per-task harnesses in a Databricks-run benchmark we analyzed (cost analysis) | Pro $20 ($17 annual), Max 5x $100, Max 20x $200, shared pool, overflow via API-rate usage credits (pricing, help center) | Free app plus model spend; Go $10/month with published caps; Zen pay-per-token at zero markup (Go, Zen) | Plan quotas or API rates: Sol $5/$30, Terra $2/$12, Luna $0.20/$1.20 per 1M tokens after July 30 cuts; Sol cut further over 20% on August 21 for three months (GPT-5.6 updates, price post) |
Five Rows That Decide the Purchase#
Model freedom vs model depth. pi will happily run Fable 5, then GPT-5.6 Terra, then a local llama.cpp model in one session, converting thinking traces across providers as it goes (origin writeup). OpenCode gets you the same breadth through provider keys but without pi's mid-session handoff polish. Claude Code and Codex are walled gardens on purpose - and both walls are currently defensible, because Opus 5 (default since July) and GPT-5.6 Sol sit at the top of independent coding indexes (Artificial Analysis, via OpenAI). You are trading optionality for a tuned loop either way.
The subscription-reuse trap. This is the row most people get wrong. pi accepts your Claude credentials through OAuth, but the providers documentation states plainly that third-party harness usage draws from extra usage billed per token, not against Claude plan limits. Your Max subscription does not follow you into pi. The ChatGPT route is different: OpenAI officially endorses pi's Codex-based login through its Codex for OSS program. Meanwhile Claude Code and Codex treat their subscriptions as the whole point, and OpenCode sells you its own cheaper rails instead.
Orchestration is a spectrum, not a checkbox. Claude Code ships backgrounded nested subagents, teams with messaging, and rerunnable workflows (agents). OpenCode gives you structured primary/subagent definitions. Codex pushes parallelism outward into cloud tasks and headless fleets rather than in-session spawning. pi began by refusing the category and handing you tmux - which, as we found in the Herdr comparison, is more observable but entirely on you.
Session trees are becoming table stakes, three ways. pi's branching JSONL remains the purest expression: alternatives live in one file you can parse in twenty lines (session format). Claude Code responded with branchable, fork-default sessions and checkpoint rewinds (sessions, week 33) - closed format, capable UI. OpenCode and Codex CLI have nothing comparable documented today.
Telemetry posture is now a selection criterion. Anthropic documents an unusually detailed telemetry surface: metrics on by default, error reporting on for subscription sign-ins, a consumer training toggle that flips retention between 30 days and 5 years, and a WebFetch hostname check that always runs (data usage). Everything has named opt-outs, which is better than most, but the defaults are chatty. pi keeps everything in local plain-text JSONL by construction. For proprietary code under compliance pressure, this row alone can make the decision.
Verdict Profiles#
Pick pi if...#
You are a developer who wants to own the harness. Concretely: you want one agent loop across any provider including local models, sessions as inspectable files, scripting surfaces from one-liners to an embedded SDK, and you accept assembling permissions (containers), sub-agents (tmux or packages), and todos yourself. The Neovim tax is real - expect to spend an evening on extensions and to pin versions on a pre-1.0 project shipping near-daily (releases). The payoff is a tool nobody can take away from you and the lowest measured cost per task in its benchmark class.
Pick Claude Code if...#
Your work is long-horizon surgery on one large codebase, and you want the machine to handle orchestration, not configure it. Skills encode your team's repeated workflows, agent teams fan out coordinated work, routines automate the boring loops, and every surface from phone to CI shares one engine (overview). You pay for that with model lock-in, a shared quota pool that chat competes with (pricing FAQ), and the most instrumented telemetry defaults in this comparison (data usage).
Pick OpenCode if...#
You want an open-source, model-agnostic main agent with product polish and predictable costs. It sits deliberately between pi and Claude Code: more batteries than pi (plan mode, undo, LSP integration, MCP), more freedom than Claude Code (75+ providers, MIT), and first-party pricing that undersells both - $10 a month on Go for capped open-model usage, or Zen at token-plus-nothing (Go). Our developer guide covers setup end to end. Choose it over pi when you want features preassembled; choose it over Claude Code when vendor or price lock-in is the deciding factor.
Pick Codex CLI if...#
You already pay for ChatGPT Plus or above and your bottleneck is supervising many concurrent agents rather than depth in one session. Worktree isolation, delegated cloud tasks, and codex exec make it the strongest fan-out harness here (our field notes), and the GPT-5.6 price cuts made its quota stretch further in July and again on August 21 (price post). Verify context-window behavior against your workload before committing - the client caps are not yet what the marketing pages imply (issue #38917).
Who should NOT leave Claude Code#
Be honest about fit before migrating. Stay put if: your team runs on managed settings, analytics, gateway spend limits, or zero-data-retention agreements - none of which the open tools document equivalents for (admin setup); your workflows are encoded in skills and hooks that assume Claude-model behavior; your repos are large enough that long-context coherence is the binding constraint; or you simply cannot spend configuration hours, because pi's flexibility is purchased exactly there. A harness migration is a week of friction for a capability delta you may not need - the correct move for most Claude Code shops is running pi or OpenCode as a second, cheap, scripted lane before considering a divorce.
FAQ#
Is pi ready to be a main harness or still a hobby?#
Ready, with conditions. It drives real production work for its ecosystem - distributions like LazyPi and oh-my-pi exist because people run it daily (HN minimalism thread) - but it moves fast (1.0 landed October 1 and v1.4.0 followed three weeks later), and expects you to assemble safety and orchestration. If you want software, not a kit, it will feel unfinished.
Can I reuse my Claude Max or ChatGPT subscription in pi?#
ChatGPT Plus/Pro: yes, officially endorsed via the Codex OSS program. Claude Pro/Max: technically yes through /login, but the docs state usage draws from extra usage billed per token, not your plan allowance (providers doc). Budget accordingly - this surprises people at invoice time.
Which tool is cheapest for heavy daily use?#
Order of magnitude, cheapest first for comparable volume: pi on discount API providers or local models, OpenCode Go at $10/month with published caps, Codex on post-cut Luna/Terra rates, then Claude Code Max tiers (matrix above). But raw token price is not cost per task - pi's lean context repeatedly measured cheapest per completed task in the benchmark we analyzed (cost post), and a harness that burns half the tokens can beat a bigger subscription.
Does anything else match pi's session trees?#
Not yet in open form. Claude Code now branches and forks sessions with checkpoints, which covers the interactive workflow (sessions), but its transcript format is not a documented, user-parseable tree. OpenCode and Codex CLI document resume but not alternative-branch exploration. If forking experiments is how you think, pi is still the reference implementation.
What about Vercel's fx?#
A new minimalist entry: Zig, Unix-style composition, repository created August 11, 2026, 2,225 stars by August 23 (vercel-labs/fx). It validates the lane pi opened but is too young for this matrix - no track record, no extension ecosystem, no pricing story yet. Watch it; do not standardize on it. For where the two minimal bets diverge, see fx vs pi.
Is Claude Code's telemetry bad enough to switch over?#
That depends on your data. The behaviors are documented and individually opt-out-able: metrics, error reports on subscription sign-ins, feedback retention measured in years, and an always-on hostname preflight for WebFetch (data usage). Commercial terms exclude your code from training, and ZDR exists for qualified enterprises. If even documented defaults are unacceptable for your repos, pi's local-JSONL posture or OpenCode's local-first sessions are the cleaner answers - just lose the features you traded away.
Which should a team standardize on?#
For regulated or larger engineering orgs: Claude Code, because team controls, deployment plumbing, and compliance paperwork are actual products there (admin setup). For startups and open-source teams: OpenCode or Codex on price and flexibility. Standardize on pi only if at least one engineer owns the harness as part of their job - it rewards an owner and punishes a vacuum.
Can extensions really close pi's feature gaps?#
Mostly, and that is the design bet. The README's own list includes community-built sub-agents, plan mode, permission gates, and MCP bridges (customization), and our hands-on guide verified working examples from sandbox policies to Herdr worker fleets. What extensions do not close well today is turnkey sandboxing - the community calls third-party options half-baked (HN) - so containerize properly rather than improvising.
That closes the series. Start with pi's architecture to understand why the minimal bet exists, work through run modes and session trees to feel the difference in your own terminal, then use this post to decide whether pi becomes your main agent, your second agent, or a philosophy you borrow ideas from. When you do run multiple agents side by side, Herdr vs pi vs tmux covers the layer above them all, and the broader four-way harness shoot-out remains the map if Cursor enters your picture.
Continue Reading#
- Claude Duet: What It Is and How It Differs from Claude Code Routines - Anthropic's new proactive agent, outside the coding-CLI lane
- Claude for Startups Offer Paused - the separate startup-program credit and why it is over capacity
- What Is an Agent Harness? A Developer's Map for 2026 - the pillar guide that maps every kind of harness and how to choose
- Pi 1.0 Release Guide: MCP, Codemode and Pi Durable - Pi added built-in MCP and a fullscreen TUI default on October 1, after this comparison
- OpenCode - pricing, model support, and alternatives on one page
- Best CLI Tools for Developers - the wider terminal toolkit these agents run inside
- What's New in Vercel AI SDK 7 (October 2026): Harnesses, Tool Search, Retries
- Claude Agent SDK in Late 2026: What Is New and How to Use It
Get the next comparison like this in your inbox
One email a week on pi and the rest of the AI dev stack. Free.
Read next on Claude Code
pi Deep Dive: The Minimal Architecture Behind 95,000 GitHub Stars
pi coding agent toolkit deep dive: five packages, branching JSONL session trees, four run modes, and why it refuses to build sub-agents, plan mode or MCP.
10 min readHands-On With Pi: Run Modes and JSONL Session Trees
Pi coding agent hands-on guide - verified install and auth steps, all four run modes from TUI to SDK, and JSONL session trees with branch, fork and resume.
10 min readClaude Code vs Codex vs Cursor vs OpenCode: Which Agent Ships More Code?
Four agents, same tasks: honest trade-offs between Claude Code, Codex CLI, Cursor Agent and OpenCode from a developer shipping production apps with all of them.
10 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.







