Back to terminal directory

AI coding agents · AI coding

Pi

Minimal coding agent with four tools and a short prompt, extended through TypeScript extensions, skills and packages.

Open sourceTypeScript
Official site
Short answer

Pi is a minimal, open-source coding agent for the terminal created by Mario Zechner and released under the MIT license. It gives the model four tools, read, write, edit and bash, and a system prompt that together come to under 1,000 tokens, leaving the rest of the context window for your code. It has no built-in subagents or plan mode by design. You add what you need through extensions, skills and packages. Pi works with many model providers and can sign in to some subscriptions with /login. Install it with curl -fsSL https://pi.dev/install.sh | sh or npm, then run pi in a project.

License
MIT
GitHub, earendil-works/pi
Created by
Mario Zechner, 2025
mariozechner.at
Built-in tools
4: read, write, edit, bash
pi.dev
Node.js needed (npm install)
22.19 or later
pi.dev docs

Updated October 21, 2026How we evaluate tools

Pi coding agent guide: install, the four-tool design, extensions and modes

Pi is a terminal coding agent with a different philosophy from most of its competitors. Where Claude Code, Codex CLI and OpenCode keep adding built-in features, Pi keeps its core small and asks you to add only what you use.

Mario Zechner, known for the libGDX game framework, started Pi in August 2025. He described his reasoning in a November 2025 blog post: he wanted an agent with a short, readable system prompt, a handful of tools and no hidden behavior, so he could see exactly what the model was given and why it acted as it did. The project gathered a strong following among developers who felt the same. Armin Ronacher, creator of Flask, became one of its most active contributors. The repository now sits at earendil-works/pi, has more than 100,000 GitHub stars, and reached version 1.0 alongside a durable session feature called Pi Durable.

The four-tool design

Pi gives the model four tools:

ToolWhat it does
readRead a file, or part of one
writeCreate or overwrite a file
editReplace a specific piece of text in a file
bashRun a shell command

Everything else, such as searching code, running tests, using git or calling APIs, happens through bash, which frontier models already use well. The system prompt plus tool definitions use under 1,000 tokens. Many agents spend several thousand tokens of every request on instructions before your code appears.

Pi leaves out features that other agents treat as standard: subagents, plan mode, built-in to-do lists and background tasks. Zechner's position is that these features often add behavior you cannot see, and that a capable model with a shell can do the same work when you ask it to. If you want them, extensions can add them.

Installing Pi

MethodCommand
Install scriptcurl -fsSL https://pi.dev/install.sh | sh
npmnpm install -g --ignore-scripts @earendil-works/pi-coding-agent

The npm package needs Node.js 22.19 or later. After installing, run pi inside a project.

Models and logins

Pi works with many providers, including Anthropic, OpenAI, Google, xAI, Groq, Mistral, OpenRouter and local servers that speak the OpenAI API format. You can switch models mid-session, and Pi keeps the conversation when you do, which makes it easy to hand a hard problem to a stronger model.

The /login command signs in to supported subscription services so you can use a plan you already pay for. Check each provider's terms first. Anthropic, for example, limits consumer Claude subscriptions to its own apps, so use an API key for Claude models.

Project instructions

Pi reads AGENTS.md from your project and home directory as standing instructions, the same format used by Codex CLI, OpenCode and others. Keep build and test commands, code style and project notes there. Because Pi's own prompt is short, your AGENTS.md has more influence on its behavior than in agents with long built-in prompts.

Extensions, skills and packages

Pi's customization works at three levels:

  • Extensions are TypeScript modules that can add tools, slash commands, keyboard shortcuts and interface elements, or hook into each step of the agent loop. You can write one to block certain commands, add a confirmation step before git push, or add a subagent tool.
  • Skills are instruction files, with optional scripts, that the model loads when a task calls for them. They follow the same idea as Claude Code's skills.
  • Packages bundle extensions and skills so you can share them or install other people's from npm or git.

The community has published packages for web search, MCP support, subagents, plan modes and many other features. You choose which ones to trust and load.

Ways to run Pi

ModeHowUse it for
InteractivepiDay-to-day coding in the terminal
Printpi -p "prompt"One-off tasks and shell scripts, with text or JSON output
RPCpi --mode rpcDriving Pi from another program over stdin and stdout
SDKImport the packageEmbedding the agent in your own app

The SDK is why Pi shows up inside other projects. OpenClaw, an open-source personal assistant, uses Pi as its agent core.

Sessions

Pi stores sessions as files you can resume, branch from an earlier point and share. Branching is useful when an attempt goes wrong: go back to the message before the mistake and try a different instruction, without losing the original path.

Where Pi works well

  • Experienced developers who want to see and control everything the model receives.
  • Long sessions, where a smaller fixed prompt leaves more room for code.
  • People building their own agent workflows, through extensions or the SDK.
  • Teams that want to standardize on one small, auditable core with a vetted list of extensions.

Limits and risks

Less out of the box. New users who expect plan mode, subagents or built-in MCP support will need to install packages or work without them.

No permission prompts by default. Pi's core trusts the model with bash. Zechner argues that permission prompts give a false sense of security, since a model with a shell can find ways around them. If you want approvals, add an extension, and run Pi in a container or virtual machine for anything risky.

Third-party extensions run with your permissions. Read an extension's code before installing it, as you would any npm package.

Model quality matters more. With fewer guardrails in the prompt, weaker models make more mistakes. Pi works best with frontier models.

Pi compared with other terminal agents

ToolCore sizeLicenseExtensibility
Pi4 tools, under 1,000-token promptMITTypeScript extensions, skills, packages, SDK
Claude CodeMany built-in tools and modesProprietaryHooks, skills, plugins, MCP
OpenCodeBuild and plan agents, LSPMITCustom agents, commands, MCP, SDK
Codex CLIBuilt-in sandbox and reviewApache 2.0MCP, config
AiderEdit formats and repo mapApache 2.0Config and scripting

Choose Pi if you want a small, predictable agent you shape yourself. Choose Claude Code or OpenCode if you want more built in from the first run. See the terminal tools guide for the rest.

Frequently asked questions

What is Pi?

Pi is a coding agent you run in the terminal, like Claude Code or OpenCode, built around a deliberately small core. It gives the model four tools and a very short system prompt, and leaves features such as subagents, planning modes and to-do lists out of the core. Mario Zechner wrote it because he wanted an agent whose behavior he could predict and control. It is MIT licensed and works with many model providers.

How do I install Pi?

Run curl -fsSL https://pi.dev/install.sh | sh, or install from npm with npm install -g --ignore-scripts @earendil-works/pi-coding-agent, which needs Node.js 22.19 or later. Then change into a project and run pi. Use /login to sign in to a supported subscription or set an API key for your provider.

Why does Pi have only four tools?

Zechner's argument is that frontier models are already trained to use a shell well, so read, write, edit and bash cover almost everything an agent needs, and every extra tool or long instruction costs context and makes behavior harder to predict. Pi's system prompt and tool definitions together use under 1,000 tokens. Features other agents build in, such as subagents or plan mode, can be added as extensions if you want them.

Can I extend Pi?

Yes. Pi supports extensions written in TypeScript that add tools, commands, interface elements or hooks into the agent loop, plus skills, which are instruction files the model loads when relevant, and packages that bundle extensions and skills for sharing. Many community packages add features such as subagents, web search or MCP support.

Can I use Pi from my own program?

Yes. Besides the interactive terminal interface, Pi has a print mode, pi -p, that runs one prompt and prints the result or JSON, an RPC mode for driving it from another process over standard input and output, and an SDK for embedding the agent in your own application. OpenClaw, a popular personal assistant project, is built on Pi.

Sources

  1. Pi website
  2. Pi on GitHub
  3. Mario Zechner, What I learned building an opinionated and minimal coding agent
  4. AGENTS.md format
  5. OpenClaw