Pi vs Claude Code
Pi and Claude Code are both terminal coding agents that drive an LLM through a file-editing agent loop. The decision between them turns on how much control you want over the agent's behavior and extension points.
| Feature | Pi | Claude Code |
|---|
| License | MIT | Proprietary |
| Self-hosting | Yes (npm install) | No |
| Default tools | read, write, edit, bash | Proprietary set |
| Extension model | TypeScript extensions + pi packages | MCP servers |
| Permission prompts | None by default | Built-in |
| Plan mode | Extension / not built-in | Built-in |
| MCP support | Extension / not built-in | Built-in |
| Sub-agents | Extension / not built-in | Built-in |
| LLM providers | 30+ (any provider) | Anthropic-first |
| In-place session branching | Built-in (/tree) | Not built-in |
Pi is the stronger choice when you want to control and extend the agent loop itself. Its TypeScript extension API lets you add tools, replace built-in ones, build permission gates, wire in sub-agent patterns, and ship custom UI, all without forking the project. The MIT license and npm distribution mean you can audit, fork, and deploy it commercially without restriction.
Claude Code is the better choice when you want MCP integrations, plan mode, and permission prompts working out of the box without writing TypeScript. Claude Code also integrates tightly with Anthropic's tooling and subscription tiers, which matters for teams on Claude Pro or Max plans who want the lowest-friction setup.
The clearest difference is the security model. Claude Code ships permission prompts that ask before executing filesystem and shell operations. Pi runs with the full permissions of the launching user and has no built-in restriction layer. For most single-developer workflows on trusted code this is not a problem, but for teams running agents against unfamiliar codebases, Claude Code's default-cautious approach may be the safer starting point. Pi's containerization patterns (Docker, Gondolin, OpenShell) fill the same role but require explicit setup.