Pi is a minimal terminal coding harness from Earendil Inc. (creator Mario Zechner, the author behind libGDX). It ships with just four core tools — read, write, edit, and bash — and a system prompt around 1,000 tokens, then lets you extend everything else with TypeScript extensions, skills, prompt templates, and themes. With 85k+ GitHub stars, MIT-licensed, and 15+ model providers, Pi is built to adapt to your workflows instead of the other way around.
Key Features
- Truly minimal core: Four tools (read, write, edit, bash) and a ~1,000-token system prompt keep context lean; other harnesses burn 5,000-15,000 tokens before you type anything.
- Self-modifying: Pi reads its own docs and examples, so you can ask it to build a new command, tool, or workflow — then hot-reload with
/reloadwithout exiting. - Four modes: Interactive TUI, print mode (
pi -p "query") for scripts/CI, JSON event stream mode, RPC mode for non-Node integrations, and an SDK to embed Pi in your apps. - Session trees: Every conversation is stored as a tree in one JSONL file — branch at any point with
/tree, navigate, bookmark, export to HTML, or share via gist. - 15+ providers: Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi, MiniMax, NVIDIA, OpenRouter, Ollama, and more; switch models mid-session with
/modelorCtrl+L. - Context engineering: AGENTS.md and SYSTEM.md loading, customizable compaction, on-demand skills, prompt templates, and dynamic context via extensions.
- Packages: Bundle extensions, skills, prompts, and themes as Pi packages, installable from npm or git (
pi install).
Use Cases
Who Should Use This Tool?
- Minimalists: Developers who want a lean harness without opinionated built-ins like plan mode, to-dos, or permission popups.
- Power users: People who want to build their own sub-agents, permission gates, sandboxing, or MCP support as extensions.
- Scripting & CI: Teams that run agents non-interactively via print mode or RPC in pipelines.
Problems It Solves
- Context bloat: A tiny core prompt plus on-demand skills keep the context window clean, cutting token waste.
- Locked-in workflows: No sealed product — if you need a feature, ask Pi to build it or install a package.
- Lost conversation history: Session trees let you branch experiments and return to any earlier point in a single file.
Pricing
| Plan | Price | Features |
|---|---|---|
| Open Source | $0 | Full harness, extensions, skills, packages. MIT License. |
Pi is free and open source (MIT). Install via curl -fsSL https://pi.dev/install.sh | sh, npm install -g @earendil-works/pi-coding-agent, or Homebrew/pnpm/bun. Model usage is billed by your providers.
Advantages & Unique Selling Points
Compared to Competitors:
- Minimalism by design: No MCP, sub-agents, plan mode, to-dos, or permission popups by default — features that other agents bake in, you build or install.
- Self-extending: Pi can read its own docs and examples and customize itself on the fly, then reload without restarting.
- Provider freedom: 15+ providers and mid-session model switching, unlike harnesses tied to a single vendor.
What Makes It Stand Out:
- 85k+ GitHub stars, MIT-licensed, built in the open by Earendil Inc.
- Session trees with branching and sharing in one JSONL file.
- Four operating modes including RPC and SDK for programmatic use.
User Reviews
"Pi's system prompt and tool definitions come in at around 1,000 tokens. Other solutions burn 5,000 to 15,000 tokens before you've typed anything." — Teleport, YouTube review
"Not having built-in to-dos straight up is such an advantage because those built-in to-dos are a massive foot gun. The agent will use them just because it can and they encourage short-sightedness." — Dracon Dev & AI, YouTube review
Getting Started
Quick Start Guide
- Install:
curl -fsSL https://pi.dev/install.sh | shornpm install -g --ignore-scripts @earendil-works/pi-coding-agent. - Authenticate: Run
/loginto pick a provider, or set an API key likeANTHROPIC_API_KEY. - Start: Run
piin a project directory to launch the interactive TUI. - Extend: Ask Pi to build the command, tool, or workflow you need, then
/reload.
Integration
- Providers: Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi, MiniMax, NVIDIA, OpenRouter, Ollama.
- Programmatic: RPC over stdin/stdout, JSON event streams, Node.js SDK.
- Real-world: OpenClaw uses Pi as its underlying coding agent.
- Platforms: macOS, Linux, Windows, and Termux on Android.
Frequently Asked Questions
Why doesn't Pi have MCP or sub-agents by default?
Pi deliberately skips features like MCP, sub-agents, plan mode, and permission popups to keep the core minimal. You can build any of them as a TypeScript extension or install a Pi package that provides them.
Can I switch models mid-session?
Yes. Use /model or Ctrl+L to switch models anytime, and Ctrl+P to cycle through favorites.
Is my session history preserved?
Yes. Sessions are stored as trees in JSONL files — you can branch, navigate back, export to HTML, or share via gist.
Alternatives
If Pi isn't the right fit, consider these alternatives:
- OpenCode: Open-source terminal AI coding agent with multi-provider support.
- Aider: AI pair programming in the terminal, focused on git-based workflows.
- Claude Code: Anthropic's feature-rich coding agent with MCP and sub-agents built in.
Tips & Best Practices
- Keep context light: Load skills on demand instead of piling everything into the system prompt.
- Use session trees for experiments: Branch risky explorations with
/treeand return to a known-good point in the same file. - Ask Pi to build what you need: Before installing third-party tools, ask Pi to read its docs and build the extension itself.
Conclusion
Pi is the harness for people who want their tools to fit their workflow, not the other way around. A minimal core, self-modifying extensions, session trees, and provider freedom make it one of the most flexible coding agents available — and at 85k+ stars, one of the most loved open-source ones.
Comments
No comments yet. Be the first to comment!
Related Tools
Kimi Code CLI
www.kimi.com/code
Kimi Code CLI is Moonshot AI's open-source AI coding agent that runs in your terminal — reading and editing code, running shell commands, and planning its next steps with Kimi K2 models.
Qwen Code
github.com/QwenLM/qwen-code
Qwen Code is Alibaba's open-source AI coding agent that lives in your terminal — with auto-memory, subagents, MCP, and multi-protocol support for OpenAI, Anthropic, Gemini, and Qwen models.
OpenCode
opencode.ai
An open-source AI coding agent that lives in your terminal, helping you understand codebases, plan features, and write code efficiently.
Related Insights
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.
Stop Cramming AI Assistants into Chat Boxes: Clawdbot Picked the Wrong Battlefield
Clawdbot is convenient, but putting it inside Slack or Discord was the wrong design choice from day one. Chat tools are not for operating tasks, and AI isn't for chatting.

Anthropic Subagent: The Multi-Agent Architecture Revolution
Deep dive into Anthropic multi-agent architecture design. Learn how Subagents break through context window limitations, achieve 90% performance improvements, and real-world applications in Claude Code.