← Corpus / ai-labs / exploration
ai-labs/explorations/when-claud-code-and-when-pi
- Path
- explorations/When-Claud-Code-and-When-Pi.md
Pi vs. Claude Code
Pi (@mariozechner/pi-coding-agent) is a minimal, aggressively-extensible terminal coding harness — an alternative to Claude Code. Here’s how they relate.
Similarities
- Both are terminal-based coding agents you
cdinto a project and talk to. - Both load
AGENTS.md/CLAUDE.mdcontext files (pi reads either) from~, parent dirs, and cwd. - Both can use Claude models — pi works with your Anthropic Claude Pro/Max subscription via
/login, orANTHROPIC_API_KEY. - Both ship with the same primitive toolset:
read,write,edit,bash(pi addsgrep,find,ls). - Both support Agent Skills (the standard from agentskills.io).
Key Differences (pi’s philosophy)
Pi deliberately omits features Claude Code bakes in, expecting you to add them via extensions or pi packages instead:
| Feature | Claude Code | Pi |
|---|---|---|
| Sub-agents | Built-in | Build via extension, or use tmux |
| Plan mode | Built-in | Write to a file, or extension |
| Permission popups | Built-in | Extension, or run in container |
| Built-in to-dos | Yes | Use TODO.md |
| Background bash | Yes | Use tmux |
| MCP | Yes | Skipped — use CLI tools w/ READMEs (Skills), or extension |
| Provider lock-in | Anthropic-only | 25+ providers (OpenAI, Gemini, Bedrock, OpenRouter, local, etc.) |
| Sessions | Linear | Tree-structured (/tree, /fork, /clone, branching) |
| Customization | Limited | TS extensions, themes, prompt templates, sharable npm/git packages |
| RPC / SDK | No | Yes (--mode rpc, full TS SDK) |
Practical “switching from Claude Code” tips
- Install:
npm install -g @mariozechner/pi-coding-agent - Use your Claude subscription: run
pi, then/login→ Anthropic. - Your
CLAUDE.mdfiles just work — pi reads them automatically. - Pick the Claude model:
Ctrl+L(or/model) to switch between Sonnet/Opus/Haiku,Shift+Tabcycles thinking levels. - Branching instead of “undo”: use
/tree(Esc Esc) to jump back to any prior point — much more powerful than Claude Code’s linear history. - Add what you miss: if you want Claude Code-style plan mode, sub-agents, or permission gates, install a pi-package (
pi install npm:...) or write a small TS extension. The README explicitly says you can “make pi look like Claude Code” via extensions.
When to pick which
- Claude Code: want batteries-included, Anthropic-only, opinionated workflow.
- Pi: want a minimal core, multi-provider freedom, and full control to shape the agent (extensions, skills, RPC/SDK embedding, OSS session sharing).
For deeper comparison, see the philosophy section in the pi README and the linked blog post.