Pi is a minimal, open-source coding agent harness (a terminal CLI) from Earendil. The reason it caught my attention: the harness you wrap around a model, not just the model, drives cost. A Databricks evaluation found that for the same model, switching harness can cut cost roughly 2x, and pi sits right on the efficient frontier. That is a real lever on my token spend.

The discovery: the harness saves ~2x

From a Databricks evaluation shared by CEO Ali Ghodsi: 3,000+ engineers, 3 clouds, many languages and tasks, run on their own code base. Cost per task (x) against overall pass-rate (y); the red dashed line is the efficient frontier.
The takeaway is that the choice of harness, for the same model, changes cost by about 2x at similar quality. Reading the frontier:
| Setup | Pass-rate | Cost/task |
|---|---|---|
| Opus 4.8 (pi, high) | ~85% | ~$0.90 |
| Opus 4.8 (claude code, high) | ~87% | ~$2.10 |
| Opus 4.8 (pi, xhigh) | ~90% | ~$2.20 |
| Opus 4.8 (claude code, max) | ~89% | ~$4.30 |
| GLM 5.2 (pi) | ~87% | ~$1.30 |
Same Opus 4.8 model: under pi it lands ~85% for ~$0.90, versus ~$2.10 under Claude Code for a couple of points more. Push pi to xhigh and it tops the chart at ~90% while still undercutting Claude Code's priciest runs. The eval also flagged GLM 5.2 (z.ai) as strong value on pi. Numbers are read off the chart, so treat them as approximate.
What it is
- A terminal-first coding agent harness: Read, Write, Edit, Bash, and a model loop.
- Open source, MIT-licensed, from Earendil.
- Bring-your-own-key and provider-agnostic: one agent loop runs against Claude, GPT, Gemini, Grok, DeepSeek, local models, 20+ providers. No single-lab lock-in, no bundled subscription.
- Minimal by design, extended by you rather than shipped fully-loaded.
For business people
The insight worth internalizing: your AI coding cost is not set by the model alone. The harness (how it manages context, tools, and turns) moves cost by ~2x for the same underlying model and similar output quality. If you are paying per token at scale, the harness is a cost lever most teams ignore.
Pi leans into that. It is bring-your-own-key, so you pay providers directly at API rates and can point the same tool at whichever model is cheapest for a given task, instead of being locked to one lab's subscription. It is free and open source, so there is no seat cost. Databricks pairs this with a router ("Omnigent") to multiplex harnesses and models per task, which is the enterprise version of the same idea.
The trade-off: pi is minimal and technical. It is a terminal tool you shape with extensions, not a polished, batteries-included product. If you want plan mode, permission popups, and a to-do system out of the box, Claude Code or Codex are friendlier. If you want maximum control and lower cost, pi is the play.
For technical people
Pi keeps a four-tool core (Read, Write, Edit, Bash) and self-extends at runtime through TypeScript extensions, skills, prompt templates, themes, and packages. What it deliberately leaves out (and treats as extension points): MCP support, sub-agents, permission popups, plan mode, to-do lists, and background bash. The philosophy is a small core you reshape, not a fixed product.
It runs in four modes:
- Interactive TUI for normal use.
- Print / JSON (
pi -p "query") for scripting and pipelines. - RPC for driving it from another process.
- SDK for embedding the agent loop in your own app.
Other details: a unified model API across 20+ providers, tree-structured branching conversation history with export/share, and mid-session model switching. Install via npm:
npm install -g @mariozechner/pi-coding-agent
pi -p "explain this repo"
Why it matters for me
I run long Claude Code and Cowork sessions building skills, notes, and research, so token cost is a real line item. Two things here are directly useful: the general principle that the harness is a ~2x cost lever, and pi specifically as a BYOK, model-agnostic option that lets me route the cheapest capable model per task and script the agent (pi -p, RPC, SDK) into my own Python tooling. The cost of entry is that pi is DIY and terminal-only, versus the convenience of Claude Code. Pairs well with what I noted on Context Rot and the Re-fresh Skill: cheaper runs plus disciplined context management compound.
Further Reading

