Pi vs Claude Code comes down to whether you want a finished product or a small harness you shape yourself. Pick Claude Code if you want permission modes, plan mode, subagents and IDE integrations ready on day one with a Claude plan. Pick Pi if you want a minimal, MIT licensed agent that works with many model providers, sends far less instruction text to the model, and lets you add only the features you need as TypeScript extensions.
The comparison is trending because a post titled Goodbye Claude, hello Pi reached 778 points and 474 comments on Hacker News by the morning of November 9. The author's complaints were release churn, prompt overhead and the AGENTS.md versus CLAUDE.md split. We tested two of those claims ourselves instead of repeating them.
Pi vs Claude Code at a glance
| Item | Pi 1.5.0 | Claude Code 2.1.318 |
|---|---|---|
| License | MIT, open source | Commercial, under Anthropic's terms |
| Models | 15+ providers, switch mid session | Claude models; Bedrock, Vertex and other third party providers on some surfaces |
| Where it runs | Terminal, plus print, JSON, RPC and SDK modes | Terminal, VS Code, JetBrains, desktop app, web |
| Built in tools (our test) | 4: read, bash, edit, write | 12 sent up front, more loaded on demand |
| Approvals | None by default, build your own | Six permission modes, from Manual to auto |
| Plan mode and subagents | Not built in, add by extension or package | Built in |
| Project instructions | AGENTS.md and CLAUDE.md | CLAUDE.md, or AGENTS.md when no CLAUDE.md exists |
| Cost of the tool | Free | Needs a Claude subscription or Console account |
Sources: pi.dev, the Claude Code overview and our own request captures described below.
What Pi is
Pi is a minimal agent harness from Mario Zechner, now published by Earendil as the @earendil-works/pi-coding-agent package. Version 1.5.0 shipped on November 2, 2026, and the GitHub repository had about 121,000 stars when we checked. Its homepage is blunt about scope: it says Pi skips features like subagents and plan mode, and it lists what it did not build, including permission popups, built in to do lists and background bash. MCP was on that list until Pi 1.0, which added built in MCP support plus Codemode.
The idea is that you add what you need. Extensions are TypeScript modules that can register tools, commands, keyboard shortcuts and UI. You can install packages from npm or git with pi install, or ask Pi to write an extension and reload it with /reload. Sessions are stored as trees you can branch with /tree and export or share. For a broader look at what a harness does, see what is an agent harness.
What Claude Code is
Claude Code is Anthropic's coding agent. It runs in the terminal, in VS Code and JetBrains, in a desktop app and on the web. It ships the features Pi leaves out: permission modes you cycle with Shift+Tab, a plan mode, subagents that run in their own context window, hooks, skills, mods and MCP. Since v2.1.283, auto mode, where a classifier model reviews actions instead of you, is the starting permission mode for interactive terminal and VS Code sessions.
It moves fast. The npm registry lists 277 Claude Code versions published so far in 2026, against 62 for Pi's package. That pace brings features quickly, and it is also the stability complaint at the heart of the Hacker News post.
Pi vs Claude Code token usage: what we measured
"Pi vs Claude Code token usage" is one of the top Google suggestions for this comparison, so we measured the part we could measure without spending money: how much text each tool sends before your prompt even counts.
We ran both tools in print mode against a local server that imitates Anthropic's Messages API, with a fake key, the same model id, the same one line prompt and the same tiny repository. The server saved the first request from each.
| First request | Pi 1.5.0 | Claude Code 2.1.318 |
|---|---|---|
| Whole request body | 5,977 characters | 86,184 characters |
| System prompt | 2,247 | 27,126 |
| Tool definitions | 4 tools, 3,334 | 12 tools, 46,633 |
| Bash tool description alone | 248 | 10,748 |
| First user message (prompt plus injected context) | 105 | 11,332 |
Claude Code's first user message was mostly injected reminders: environment details, git status, available subagent types, deferred tools you can load through its ToolSearch tool, and a list of built in skills that alone ran to about 6,200 characters. Pi's system prompt is a short list of its four tools, a few rules, pointers to its own docs and the working directory.
Three caveats keep this honest. First, these are characters, not billed tokens, because we sent nothing to a real model. Second, both tools marked their requests for prompt caching, and Anthropic bills cache reads at 0.1 times the base input price for most models, so a long, stable prefix costs much less on the second turn than the first. Third, smaller is not automatically better. Claude Code spends that text describing subagents, skills and safety behavior you may want. The real gap is control: in Pi you decide what goes into the context window, and SYSTEM.md can replace the default prompt per project.
AGENTS.md and CLAUDE.md: the split we tested
Both tools now read AGENTS.md, but they disagree when a repository has both files. We put a different marker line in each file and checked what reached the model.
- Only AGENTS.md present: both Pi and Claude Code loaded it.
- Both AGENTS.md and CLAUDE.md present: Claude Code loaded only CLAUDE.md. Pi loaded only AGENTS.md.
The Claude Code result matches Anthropic's memory docs: reading AGENTS.md needs v2.1.277 or later, and by default Claude reads it only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists in your working directory or above it. A /config setting called Project instructions can make it read both. Pi's configuration docs say it loads context files from its agent directory, the working directory and parent directories, without needing project trust.
The practical fix if your team mixes both tools: keep the real instructions in AGENTS.md and make CLAUDE.md a one line import of it, or set Claude Code to read both. Our AGENTS.md guide covers writing the file itself.
Safety and permissions
This is the biggest functional difference, and it cuts both ways.
Pi's security page says Pi "does not ask for approval before every tool call" and that watching the transcript or reviewing changes is not a security boundary. Its recommendation is to run Pi inside a container, virtual machine or sandbox and to give it only the files and credentials the task needs. Project trust stops a repository from silently loading extensions or MCP servers, but AGENTS.md and CLAUDE.md still load, and Pi tells you to treat them as untrusted input.
Claude Code ships guardrails instead. Manual mode asks before edits, shell commands and network access. acceptEdits approves file edits. dontAsk suits locked down CI. bypassPermissions is meant only for isolated containers and VMs. Deny rules apply in every mode, and some actions, such as dangerous rm operations, are never auto approved. The approvals you save have their own risk, covered in Claude Code settings.local.json.
If you choose Pi, plan the sandbox up front. Our E2B vs Daytona vs Modal comparison covers hosted options, and a local Docker container works for most solo setups.
Models and cost
Pi itself is free. You pay for whatever model you connect. Per pi.dev, that includes Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, xAI, OpenRouter, Ollama and more, authenticated with API keys or provider sign in, and you can switch models mid session with /model. Custom endpoints go in models.json, which is also how we pointed it at our test server.
Claude Code needs a Claude subscription or an Anthropic Console account for most surfaces; plan prices are on Claude's pricing page. The terminal CLI and the IDE extensions can also use third party providers such as Bedrock and Vertex. If you want one tool across many model vendors, Pi is the more natural fit. If you already pay for a Claude plan and mostly use Claude models, Claude Code gives you more for the same subscription.
Which should you use?
Choose Claude Code if you want approvals, plan mode, subagents, IDE panels and a desktop app without building anything, you mostly use Claude models, and you are fine with frequent updates changing behavior.
Choose Pi if you want a small, stable core you understand end to end, model freedom, tight control over the context window, and you are willing to run it in a sandbox and write or install a few extensions. The blog author says he wrote an extension for a missing IDE feature in about 20 minutes; your mileage depends on how much you want to customize.
Consider a middle option if neither fits. OpenCode is open source and model agnostic like Pi but ships plan mode, subagents and permission prompts. OpenAI Codex CLI has sandbox modes and approval policies built in. Our Pi coding agent alternatives guide compares them, and Claude Code vs Codex vs Gemini CLI covers the vendor CLIs.
Whichever you pick, keep your setup portable. AGENTS.md, Agent Skills and MCP servers work in both, so switching later costs an afternoon, not a rewrite.
FAQ
Is Pi better than Claude Code?
Neither is better for everyone. Pi is better if you value a minimal, customizable core and model choice. Claude Code is better if you want guardrails and a full feature set out of the box. We did not compare code quality, which depends mostly on the model you connect.
Does Pi use fewer tokens than Claude Code?
In our test Pi's first request was about one fourteenth the size of Claude Code's, measured in characters. Billed tokens depend on the model, caching and how long the session runs, so treat that as a measure of fixed overhead, not your bill.
Can Pi read my CLAUDE.md file?
Yes. Pi loads AGENTS.md and CLAUDE.md context files. In our test, when both existed in the same folder, Pi sent only AGENTS.md, so keep shared instructions there.
Does Claude Code support AGENTS.md now?
Yes, from v2.1.277. By default it reads AGENTS.md only when your project has no CLAUDE.md or CLAUDE.local.md; the Project instructions setting in /config can make it read both.
Does Pi have plan mode or subagents?
Not built in. Pi suggests writing plans to files, spawning extra Pi instances in tmux for parallel work, or installing an extension or package that adds plan mode or subagents.
Is Pi safe to run on my laptop?
Pi does not ask before running commands, so its own docs recommend a container, virtual machine or sandbox, with only the credentials the task needs. Running it directly gives it the same access as your user account.



