Pi

A hackable coding-agent harness for developers who would rather extend it than wait for features

AI agent toolkit: unified LLM API, agent loop, TUI, coding agent CLI

No video published yet. The write-up below covers what the tool does and how to try it.

Category
AI agents & assistants
Audience
Developers
Language
TypeScript
Licence
MIT

Published Updated

Pi is a minimal, extensible agent harness: one repository that bundles a unified LLM API, an agent loop, a terminal UI and a coding-agent command line. It is aimed at developers who already live in a terminal and want the agent itself to be editable rather than fixed. The project is MIT-licensed TypeScript from earendil-works, and it has drawn an unusually large audience for its age — about 112,000 stars and 14,000 forks since its first commit in August 2025.

What it does

Pi gives you a coding agent you can run interactively, and the same agent as something you can automate or embed. The README lists four ways in: interactive use, print or JSON mode for scripting, RPC control from another process, and the Pi TypeScript SDK for building your own app on top. OpenClaw is named as a real-world integration that does exactly that.

The customisation surface is the point. Pi accepts extensions, skills, prompt templates and themes, and lets you bundle those into "Pi packages" shared over npm or git. The flip side is stated plainly in the README: Pi deliberately skips features other agents advertise, including sub-agents and plan mode. The maintainers' answer is to ask Pi to build what you want, or install a package that already does it your way.

The video covers the 1.0 release, whose headline is a leaner "codemode". Codemode used to repeat each tool's full declaration in every request; the new version does not. Alongside that:

  • Codemode errors now tell the model how to recover instead of just failing.
  • Codemode can generate images straight from a script.
  • Sign-in for MCP servers over OAuth is hardened.
  • The terminal UI runs fullscreen by default.

How it works

The savings claim is about prompt overhead, not about the model. Pi's release notes report roughly 40 percent fewer prompt tokens after the codemode rewrite, and cite one request falling from about 5,300 tokens to about 3,300. That is the project's own figure from its own release notes — no independent benchmark appears in the material, so read it as the authors' claim about their change rather than a measured result on your workload. Fewer prompt tokens mostly means a smaller bill per turn and more context left for your actual code.

The rest follows from the description: a unified LLM API underneath so the provider is swappable, an agent loop above it, and the TUI and CLI as front ends on that same loop. MCP is how Pi reaches outside tools, and the OAuth hardening in 1.0 concerns that connection.

Getting started

The repository is github.com/earendil-works/pi. Install the CLI with one command:

curl -fsSL https://pi.dev/install.sh | sh

On Windows: powershell -c "irm https://pi.dev/install.ps1 | iex". The README notes that the installer pins all dependencies and that pi update upgrades in place; installing straight from npm (@earendil-works/pi-coding-agent) works but does not pin transitive dependencies.

What it costs: the code is free under MIT, the intelligence is not. You bring your own API key or a provider subscription — there is no hosted free tier here, and the material names no bundled credits. The project doesn't list hardware requirements, and nothing in the material says it runs a local model for you, so budget for per-token API spend. Node tooling is implied by the npm package, but no version is stated.

When to use it / when not

The main catch is the cost model: Pi is a harness, and every turn goes to a paid model under your own key. A second, unusual catch sits at the top of the README — issues and pull requests from new contributors are auto-closed by default, with maintainers reviewing the auto-closed ones daily. That is workable, but it is not the normal open-source front door, and it is worth knowing before you plan on upstreaming a fix.

Use it instead of Claude Code when you want the harness itself to be yours — themes, prompt templates, skills, packages you publish — or when you want to drive the agent over RPC or an SDK instead of only typing at it. Don't use it if you expect sub-agents or plan mode out of the box, or if you want a vendor to absorb the model cost.

Pi deserves a look from any developer who has hit the edge of a closed coding agent and wanted to reach inside it. It is young, it is actively pushed, and the 1.0 codemode work shows maintainers who care about the thing that actually costs you money, which is prompt size. Bring a budget for tokens, expect to write a little TypeScript, and treat the 40 percent figure as the project's own claim until you see it in your own logs.

More in AI agents & assistants

All of AI agents & assistants →