{"slug": "pi-agent-vs-opencode-after-100-hours-of-real-use", "title": "Pi Agent vs OpenCode after 100+ Hours of Real Use ✌️", "summary": "A developer's comparison of open-source coding agents Pi and OpenCode after 100+ hours of real use found a dead tie in features but distinct trade-offs. Pi, built by Mario Zechner, excels in efficiency, hackability, and raw results, while OpenCode offers more features, provider support, and surfaces. The evaluation showed Pi passing 21/30 tasks at $0.078 per success versus OpenCode's 19/30 at $0.119, with Pi having lower context overhead but slower median task time.", "body_md": "Open-source coding agents had a weird start to 2026.\n\nIn January, Anthropic suddenly blocked third-party tools from using Claude subscriptions. Overnight, with no warning.\n\nOpenCode got hit the hardest. The team had to remove Claude login support after legal pressure. The commit message was literally just: “anthropic legal requests.”\n\nPI never really cared. It was never built around one provider anyway.\n\nAnd that kinda brings us to the obvious question. If you’re using your own API keys anyway, which open-source agent do you actually pick?\n\nOpenCode is sitting at **199K stars**, probably past 200K by the time you read this, with around 8 million monthly devs.\n\nThen there’s Pi. Bare minimum by design. Four tools. A system prompt under 1,000 tokens. And somehow, top of our benchmark. Again.\n\nℹ️ We recently covered\n\n[Pi Agent vs. Claude Code]. Check that out if you're not sure whether Anthropic or Pi suits you better\n\nThe easiest way I’d frame it is this:\n\n💁 OpenCode is VS Code (bit bloaty). Pi is NeoVim (bare minimum).\n\nSo which one do you go for? Let's get into the difference.\n\n| Category | Pi | OpenCode | Winner |\n|---|---|---|---|\n| Real tool use (our eval) | 21/30 tasks passed, $0.078 per success | 19/30 tasks passed, $0.119 per success | Pi |\n| Total eval spend | $1.64 for all 30 tasks | $2.25 for all 30 tasks | Pi |\n| Speed | 362.9s median per task, slowest of the bunch | 280.6s median per task | OpenCode |\n| Context overhead | Under 1,000 tokens, prompt + tool defs | ~6,900 tokens per request | Pi |\n| Out-of-the-box features | Four tools | Plan mode, MCP, LSP diagnostics, undo/redo, permissions, subagents, and a lot more | OpenCode |\n| Model support | 20+ providers, 300+ models, mid-session switching | 75+ providers via AI SDK and `models.dev`\n|\nOpenCode |\n| Cheap model access | BYOK or local, that's it | Zen gateway at cost, plus Go at $10/month | OpenCode |\n| Extensibility | TypeScript extensions running inside the agent process | Plugins, custom agents, skills, mostly config-driven | Pi |\n| Sessions | Branchable session trees with fork and rewind | Linear log with undo/redo, but survives disconnects | Pi |\n| Surfaces | Terminal | TUI, desktop app, web UI, IDEs via ACP, GitHub and GitLab CI | OpenCode |\n| Permissions | Nothing. Full system access from prompt one, which isn't really my preferred style | allow/ask/deny per tool with glob patterns | OpenCode |\n| Resource footprint | Lightweight, single process | 1GB+ RAM for a TUI is kinda crazy | Pi |\n\n**Scorecard: Pi 6, OpenCode 6. Dead tie.**\n\nAnd honestly, that feels right. These two are built for pretty different kinds of people anyway.\n\nRemember the VS Code vs. Neovim thing I said earlier?\n\nPi is more like a platform you program. You get a tiny core and build your own harness around it in TypeScript.\n\nOpenCode is more like a product you configure. You get something much closer to a full Claude Code replacement on day one, then tweak it through config.\n\nPi wins on efficiency, hackability, and, at least in our eval, raw results.\n\nOpenCode wins on features, provider support, surfaces, and the simple fact that a normal person can pick it up and start using it without building half the setup themselves.\n\nSo yeah, the real tiebreaker is basically what kind of person you are. Keep reading.\n\nℹ️ A minimal terminal coding agent that ships four tools and expects you to build the rest yourself.\n\nQuick recap if you missed our [Pi vs Claude Code](https://composio.dev/blog/pi-agent-vs-claude-code) post.\n\n[Pi](https://pi.dev/) is Mario Zechner's answer to harness bloat. He got tired of Claude Code changing under him, so he built an agent where the model gets `read`\n\n, `write`\n\n, `edit`\n\n, and `bash`\n\n, a system prompt of a few hundred tokens, and nothing else. No MCP. No permissions. No plan mode. No subagents. All on purpose.\n\nIt now lives under [Earendil](https://github.com/earendil-works/pi) after his April blog post \"I've sold out,\" and the core stays open-source.\n\nThe real product is the extension system. TypeScript files run inside the same process as the agent loop, and Pi can read its own source code. So when you need a missing feature, you literally ask Pi to build it.\n\nThat design is also why Peter Steinberger picked Pi as the engine for OpenClaw.\n\n💁\n\nFun Fact:Pi has \"only\" 94k stars, but the npm package pulls around 1.3 million downloads a week. Growing crazy fast among developers.\n\nNot everyone is fond of VS Code. 🤷♂️\n\nℹ️ The most starred open source coding agent in the world, and the closest thing to an open, model agnostic Claude Code.\n\n[OpenCode](https://opencode.ai) is basically an open-source, model-agnostic coding agent that tries to give you the full Claude Code experience without locking you to Anthropic\n\nIt is built by the team behind SST, which rebranded to Anomaly in 2026 and moved the repo to `anomalyco/opencode`\n\n.\n\nThe numbers are crazy for a free tool. Around **199k stars**. Roughly 8 million monthly active developers. Cloudflare publishes official OpenCode setup docs for its own engineers.\n\nCan you believe this free thing is doing over $25M ARR? It's just the tool that's free, there's subscription plans they've introduced from where they make tons of money.\n\nThe origin story is crazier than Pi's. The original agent, called TermAI, was created by Kujtim Hoxha back in 2024. [Dax Raad](https://x.com/thdxr) and Adam Elmore did the OpenCode rebrand and made it popular. Then Charm hired Hoxha and pulled the repo into its own org. That causes rewritten git history, banned contributors, the whole drama. After the backlash, Charm renamed its fork **Crush**, and the Dax and Adam project kept the OpenCode name as a from scratch rewrite.\n\nNot anything interesting if you don't care about \"history\". Lol.\n\nSo when anyone says OpenCode in 2026, they mean the Anomaly one.\n\n💁\n\nFun fact:For the 1.0 release, the team threw out their entire Go based TUI and wrote a new framework called OpenTUI in Zig and SolidJS, because the old one \"had performance and capability issues.\" Can't believe Golang had performance issues at that scale.\n\nA coding agent team writing their own Zig rendering engine for the terminal is the most 2026 thing I can think of. Crazy stuff.\n\nOur earlier comparisons were open vs closed. This one is open vs open.\n\nBoth teams agree on the big stuff. The harness should be MIT licensed. You should bring your own model. Nobody should be vendor-locked in.\n\nThey completely disagree on how much harness should exist.\n\nOpenCode's philosophy is that the harness is a real product. Ship plan mode, permissions, LSP integration, MCP, a desktop app, a web UI, IDE support, GitHub actions. Give people everything Claude Code has, minus the lock in.\n\nPi's bet is that most of that is overhead (not a feature, what OpenCode believes). Frontier models have been RL trained so hard on coding that they already know what a coding agent is. Every tool schema and every injected instruction is context you pay for on every request. So the harness should be close to zero, and you add back only what you personally need.\n\nThe [disler comparison](https://github.com/disler/pi-vs-claude-code/blob/main/PI_VS_OPEN_CODE.md) has the cleanest one liner on this.\n\n\"Pi gives you control at the runtime level. OpenCode gives you control at the configuration level.\"\n\nAnd yes, there is real beef here. Zechner has publicly called out OpenCode's compaction for pruning tool results and breaking prompt caching.\n\nHe is not a fan of their Vercel AI SDK dependency either. More on that below.\n\nUnderneath, both use the same basic loop: read the task, call the model, run tools, feed results back, repeat.\n\nThe architecture around that loop is where they differ.\n\nOpenCode splits into a persistent local server and separate clients.\n\nThe server handles:\n\nThe TUI, desktop app, web UI, and IDE integrations all talk to that same server.\n\nThis makes sessions more safe to terminal crashes or SSH drops, and the same server can also run headlessly in CI. The downside is a heavier footprint, with people reporting **1GB+ RAM usage** for the TUI setup.\n\nYou read it right. Read more about it here: [OpenCode is pretty resource inefficient](https://news.ycombinator.com/item?id=47465584)\n\nPi keeps everything in one process:\n\nIt is all TypeScript and small enough to understand without going through a huge codebase.\n\nPi supports four run modes:\n\nThat SDK is also how OpenClaw embeds Pi.\n\nI'd call it a star feature of OpenCode, the way it handles LSP (Language Server Protocol).\n\nOpenCode can run real language servers such as `gopls`\n\nand `typescript-language-server`\n\nand feed diagnostics back into the agent after edits.\n\nSo the flow looks like this:\n\nmodel edits code → LSP reports an error → model sees it → model fixes it\n\nThat gives OpenCode fast compiler and type feedback without needing to run the full test every time.\n\nPi does not have this out of the box.\n\nPi way of handling sessions is kinda interesting.\n\nPi stores sessions as `JSONL`\n\n, with every entry pointing to a parent. That means the session history is a tree instead of one linear log.\n\n```\nA → B → C\n     ↘ D → E\n     ↘ F → G\n```\n\nYou can:\n\n`/tree`\n\nto jump back to an earlier point`/fork`\n\nto branch from any past messageOpenCode uses a linear history with `/undo`\n\nand `/redo`\n\n, which is simpler but less flexible.\n\nOpenCode uses a hidden system agent to summarize the conversation when context gets tight, then hides older messages from the active context.\n\nThe criticism is that this can remove useful tool outputs and hurt prompt caching.\n\nPi also supports compaction, but the implementation is replaceable through extensions, which fits its more hackable architecture.\n\nNow for the part I was most curious about.\n\nWe ran **30 hard agentic tool-use tasks** against real apps. Every harness used the same model, **DeepSeek V4 Pro (0813)** at max reasoning, through our hosted MCP router.\n\nSame model. Same tasks. Same tools. Same verifier checks.\n\nSo whatever gap shows up here is mostly the harness.\n\nHere is the full result.\n\n| Harness (DeepSeek V4 Pro, hard 30 set) | Tasks passed | Cost per success | Cost per shared success | Avg tokens per task | Avg turns |\n|---|---|---|---|---|---|\nPi Agent |\n21/30 (70%) |\n$0.078 |\n$0.031 | 924,990 | 16.3 |\n| Codex | 20/30 (66.7%) | n/a* | $0.031 | 383,722 | n/a |\n| DeepSeek Harness | 20/30 (66.7%) | $0.076 | $0.028 | 88,562 | 0.9 |\nOpenCode |\n19/30 (63.3%) |\n$0.119 |\n$0.032 | 710,140 | 13.1 |\n| Claude Code | 19/30 (63.3%) | n/a* | $0.074 | 649,900 | 12.1 |\n| Hermes Agent | 18/30 (60%) | n/a* | $0.037 | 113,894 | 6.5 |\n\nℹ️ *Not comparable because cost measure was incomplete for some cells. Shared success only counts tasks every harness passed.\n\nPi finished first with **21/30 tasks passed**, while OpenCode landed at **19/30**.\n\nIt was also cheaper across the full run.\n\nThat last number looks rough for OpenCode, but there is a catch.\n\nOn tasks both harnesses actually passed, they were basically tied. Pi came in at **$0.031 per shared success**, while OpenCode was **$0.032**.\n\nSo OpenCode was not really more expensive when it worked. It just failed more tasks, and **failed runs still burn tokens**.\n\nPi had the best pass rate, but it was also the **slowest harness in the entire run**.\n\nPi also averaged **16.3 turns per task**, compared with OpenCode's **13.1**, and pushed more raw tokens than anyone else.\n\nThe difference is that its fixed overhead stays tiny.\n\nThe system prompt plus tool definitions stay under 1,000 tokens, and the prefix barely changes between turns. That makes a lot of that repeated context land as cache hits.\n\n| Task | Pi | OpenCode |\n|---|---|---|\n| CRM migration archive | ✅ 10/10 | ❌ 3/10 |\n| Slack action items | ✅ 5/5 | ❌ 2/5 |\n| Vendor directory | ✅ 11/13 checks | ❌ 7/12 |\n| Handover audit | ✅ 11/11 | ❌ 10/11 |\n| PagerDuty timeline audit | ✅ 10/10 | ❌ 9/10 |\n| Renewal screen | ❌ 5/11 | ✅ 11/11 |\n| Sponsorship screen | ❌ 4/11 | ✅ 11/12 |\n| Sheets to Airtable tracker | ❌ 8/10 | ✅ 10/10 |\n\nPi did better on the **audit and census-style tasks**, where patiently reading everything and checking every detail matters.\n\nOpenCode did better on the **longer screening and multi-step workflows**.\n\nWhich is kinda perfect.\n\nPi wins by being small. OpenCode wins when the workflow benefits from more stuff around the model.\n\nAfter all this non-sense, the eval ended up being spot on for both of them. 🤧\n\nWe did a complete breakdown in this tweet. You might want to [check it out](https://x.com/composio/status/2090069397050097864).\n\n// Detect dark theme var iframe = document.getElementById('tweet-2090069397050097864-193'); if (document.body.className.includes('dark-theme')) { iframe.src = \"https://platform.twitter.com/embed/Tweet.html?id=2090069397050097864&theme=dark\" }\n\nThis is basically the argument both tools were built around, so let's put some numbers next to it.\n\nThe most cited comparison here is the [Systima study](https://systima.ai/blog/claude-code-vs-opencode-token-overhead) from July, which also ended up doing [700+ points on Hacker News](https://news.ycombinator.com/item?id=48883275).\n\nThey put a logging proxy between the harness and the model, then measured how much context gets sent **before the model even sees your prompt**.\n\n| Harness | Fixed overhead per request |\n|---|---|\n| Claude Code (measured by Systima) | ~32,800 tokens |\n| OpenCode (measured by Systima) | ~6,900 tokens |\n| Pi | Under 1,000 tokens |\n\nOpenCode already looks pretty good here. Around **4.7x less overhead than Claude Code**.\n\nThen Pi shows up with **under 1,000 tokens**, including the tool definitions.\n\nThat makes it roughly **7x leaner than OpenCode**.\n\n💁 Everyone is somebody's bloatware. 🗿\n\nMatei Zaharia [said on X](https://x.com/matei_zaharia/status/2074943619610649059) the reason was pretty simple. Pi had the same success rate with **2x less cost.**\n\nOur eval points in the same direction too. Pi had the best pass rate and the lowest total spend.\n\nBut there is an important catch here.\n\nOpenCode has had some pretty ugly token cases too. There is a [GitHub issue](https://github.com/anomalyco/opencode/issues/8234) where asking something as basic as \"what's the tech stack in this project\" burned **13,088 tokens** on a fresh project.\n\nAnd Pi is not crazy cheap in every sense either. In our eval, it actually pushed the **highest raw token count of all six harnesses**, mostly because it took more turns to finish tasks.\n\nSo yeah, tiny fixed overhead helps a lot. But **lean overhead does not always mean lean sessions**.\n\nWorth keeping that distinction in mind.\n\nBoth tools are free and MIT licensed. Fork them, modify them, ship them.\n\nThe difference starts after install.\n\n💁 Pi is basically just the harness. You bring the model and pay whoever is serving it.\n\nOpenCode does the same BYOK thing, but it also has its own model options.\n\nGo starts at **$5 for the first month, then $10/month**, with models like GLM, Kimi K3, Qwen, MiniMax, and DeepSeek.\n\n⚠️ Double check the pricing. OpenCode changes this stuff pretty often.\n\nAnd honestly, that Go plan is hard to ignore.\n\nFor $10/month, it is probably one of the cheapest legit ways to run capable open models through a coding agent right now.\n\nPi does not really have an equivalent. Its version of \"cheap\" is running local models, which is useful, but it is not the same thing.\n\nIn January 2026, Anthropic started rejecting Claude Pro and Max OAuth tokens when they were used outside Claude Code.\n\nThe error was pretty clear. The credential was **\"only authorized for use with Claude Code.\"**\n\nOpenCode had been using those subscription tokens by mimicking the Claude Code client, so this hit them directly.\n\nThen came the legal requests, the Claude login code got removed, and we got the now-famous commit message from the intro.\n\nGeorge Hotz called the move **\"a huge mistake.\"**\n\nOpenAI reportedly went in the other direction and opened Codex subscription access to third-party harnesses, including OpenCode and Pi.\n\nLol.\n\nThe important part for this comparison is pretty simple now.\n\nIf you want Claude in either Pi or OpenCode, you are basically paying API rates. OpenCode also gives you Zen as another route.\n\nBoth are highly customizable, but the extension model is very different.\n\nOpenCode is mostly config driven through `opencode.json`\n\n, plugins, agents, skills, and MCP.\n\nYou can add:\n\n`tool.execute.before`\n\n`.opencode/skills`\n\nand `.claude/skills`\n\n```\n{\n  \"permission\": {\n    \"bash\": {\n      \"git *\": \"allow\",\n      \"rm *\": \"deny\",\n      \"*\": \"ask\"\n    }\n  }\n}\n```\n\nPi extensions are TypeScript modules loaded directly into the single agent process.\n\nThey can:\n\nThat gives Pi much **deeper runtime control** than OpenCode.\n\nℹ️ OpenCode plugins extend the harness. Pi extensions can modify the harness itself.\n\nThe tradeoff is security. Pi extensions run in process with full system access, so they need more trust than OpenCode's plugin model.\n\nThis is probably the biggest gap between the two.\n\nOpenCode has a proper permission system. Every tool can be set to `allow`\n\n, `ask`\n\n, or `deny`\n\n, with glob patterns and per-agent overrides. The defaults are decent too. `.env`\n\nreads are denied by default, and the Plan agent asks before edits or bash commands.\n\nWhat it does **not** have is real sandboxing. There is no container or OS-level isolation built in.\n\nPi goes the other way and basically ships no permission layer at all. From the first prompt, the agent runs with your full user privileges. 🥶\n\nThat is intentional. Zechner's say is that once an agent can write files and execute code, permission prompts only get you so far. Pi instead expects you to isolate the whole process using Docker, a microVM like Gondolin, or a policy sandbox like OpenShell.\n\n💁 There is also an optional\n\n`damage-control.ts`\n\nextension that checks bash commands against YAML rules. Helps a bit.\n\nSo the actual difference is pretty simple.\n\nℹ️ OpenCode gives you tool-level guardrails. Pi expects you to handle isolation outside the agent.\n\n**Pick OpenCode if**\n\n`allow`\n\n, `ask`\n\n, and `deny`\n\ncontrols**Pick Pi if**\n\nThe benchmark kinda gives away the answer anyway.\n\nPi did better on the careful audit-style tasks. OpenCode did better on longer, more structured workflows.\n\nSo there probably isn't one winner for everything.\n\nBoth are free. Try both and keep the one that fits how you work. ✌️\n\nAfter all that, I still don’t think there’s one obvious winner here. The scorecard ends **6-6**.\n\nOpenCode wins on adoption, features, and ease of use. Pi won our benchmark with **21/30 tasks vs 19/30**, lower total spend, and way less fixed overhead.\n\nThe bigger difference is still the same one we started with:\n\nOpenCode gives you configuration control. Pi gives you runtime control.\n\nIf you just want to install something and start working, pick **OpenCode**.\n\nIf you want to understand and modify the harness itself, pick **Pi**.\n\nAnd if cost per successful task starts mattering at scale, keep an eye on Pi. 🤷♂️", "url": "https://wpnews.pro/news/pi-agent-vs-opencode-after-100-hours-of-real-use", "canonical_source": "https://dev.to/composiodev/pi-agent-vs-opencode-after-100-hours-of-real-use-1mh7", "published_at": "2026-08-21 13:31:28+00:00", "updated_at": "2026-08-21 13:44:37.017408+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "ai-tools"], "entities": ["Pi", "OpenCode", "Mario Zechner", "Anthropic", "Earendil", "Composio"], "alternates": {"html": "https://wpnews.pro/news/pi-agent-vs-opencode-after-100-hours-of-real-use", "markdown": "https://wpnews.pro/news/pi-agent-vs-opencode-after-100-hours-of-real-use.md", "text": "https://wpnews.pro/news/pi-agent-vs-opencode-after-100-hours-of-real-use.txt", "jsonld": "https://wpnews.pro/news/pi-agent-vs-opencode-after-100-hours-of-real-use.jsonld"}}