Pi is a minimal coding agent written by Mario Zechner, designed around a single organizing philosophy: LLMs are good at writing and running code, so embrace this rather than working around it. It is the engine underlying OpenClaw, and the agent Armin Ronacher uses almost exclusively.

As of April 2026, Pi is owned by Earendil and lives at github.com/earendil-works/pi. Mario remains full technical lead. Home: pi.dev.

Pi 1.0: minimal does not mean frozen

Earendil released Pi 1.0 on October 1, 2026. The announcement presents it as a hardened, minimal, extensible harness, with these additions:

  • Codemode: the model writes JavaScript to compose tool calls and run non-chat models such as classifiers and image models. Native MCP is part of this integration.
  • Virtual models: extensions can expose one selectable model that routes each request to physical models. The demo plans with Claude Opus and implements with GPT, using Jev to decide when to switch. This is an example, not a default routing policy.
  • Deferred tool loading: discover and expose tools as needed instead of declaring every available tool in every request.
  • Anthropic cache warming: refresh eligible prompt caches while idle. This is provider-specific, best-effort behavior, not a promise of permanent cache retention or zero cost.
  • Mid-conversation system messages: record prompt-section and tool changes in the transcript instead of treating the starting loadout as immutable. Provider support determines how those changes are represented and whether the cache remains usable.
  • A new TUI theme and full-screen mode by default. The old scrollback-only description below is no longer the current default.

The release says Pi adopts capabilities after they have proved useful enough to justify their complexity. It also announces Pi Durable as a separate experimental framework, not a redesign of the terminal agent into a multi-user durable service.

MCP and composition

The linked “You Said No MCP!” explanation (“You Said No MCP!”, dated 2026-09-29; checked point by point against the original design in Pi MCP Reversal and Its Original Design) describes the design change: use a harness-side JavaScript sandbox to discover, call, and combine MCP tools, and return selected results to the model. Structured server output matters because scripts need data they can compose, not just text written for the model to read.

The published Pi 1.0.0 documentation confirms stdio and streamable-HTTP servers, OAuth support, and configurable exposure: Codemode, deferred discovery, direct declarations, or hidden tools. Servers can report changed tool lists, and extensions can register servers during a session. Native MCP is therefore compatible with Pi’s extensibility; the older impossibility claim was too strong.

Historical claims superseded

Earlier revisions of this page said Pi had no MCP support and was architecturally incompatible with MCP. Pi 1.0 explicitly adds native support. The underlying concerns about excessive schema exposure, poor composition, and caching remain design tradeoffs, not protocol-level prohibitions. See MCP Tools vs Custom Function Tools, CLI Tools Pattern, and Self-Extending Agents for the corrected guidance.

Codemode is not a security waiver

The shipped documentation describes a QuickJS sandbox with no direct Node, filesystem, network, or timer APIs. It reaches the outside world through exposed tools and model services. Those calls still have real effects and permissions. A script failure does not undo completed calls. Calls pass through the tool pipeline, so authorization and permission extensions still matter. See Agent Security and Threat Model and Durable Tool Execution.

Pi Durable is a separate framework

Earendil announced Pi Durable on October 1, 2026 alongside Pi 1.0. It is an experimental framework for crash-recoverable tasks, persistent conversations, application documents, and multiple clients. It shares components and philosophy with Pi, but does not replace the terminal coding agent or automatically add those guarantees to existing CLI sessions.

The distinction matters: Pi’s saved session can be reopened by a human; Pi Durable persists task checkpoints and supplies recovery/replay policies for an application. See Durable Tool Execution for why submission deduplication is not exactly-once external effects. Existing comparison pages about the coding agent’s attended workflow should not silently inherit the new framework’s capabilities.

Licensing

The October 2026 announcement explicitly states that Pi 1.0 and Pi Durable are both MIT licensed. The following is the historical commercial structure discussed when Pi joined Earendil in April 2026, not evidence that either newly announced package is Fair Source or proprietary:

TierLicenseWhat it is
CoreMIT, foreverPi as you know it — non-negotiable
Value-addFair Source (DOSP)Future commercial features; source available; converts to full OSS after a delay
EnterpriseProprietaryCloud infrastructure, enterprise features; funds tiers 1 & 2

DOSP = Delayed Open Source Publication. Fair Source means free to use, source available, but not OSS until the delay expires. See Armin’s licensing post.

Governance

  • Mario Zechner: full technical direction (roadmap, merges, what’s OSS vs not), shared with Armin and Colin
  • External contributions: no CLA, no DCO — PRs reviewed as always
  • Trademark: Pi name and logo owned by Earendil (Mozilla/Linux model)
  • Repository moved from badlogic/pi-mono to earendil-works/pi. The current CLI package, confirmed by the package README (the same package name appears in Quang’s own 0.87.1 install), is @earendil-works/pi-coding-agent; this page’s earlier @earendil/pi name was stale.

Origin

Pi was born from frustration. Mario began using Claude Code in April 2025, liked it, then started to get annoyed as Anthropic kept adding features and modifying the toolset and system prompt — sometimes in ways that broke his workflows. Before building pi, he hacked Claude Code itself: patched the binary to disable anti-debugging checks, monkeypatched fetch to intercept API calls, and built a suite of companion tools (claude-trace, claude-bridge, cccost). He even built cchistory.mariozechner.at to track system prompt diffs between versions.

The conclusion: he wanted an agent harness that works exactly the way he wants, stays stable, and doesn’t have built-in anti-patterns. Pi was built to scratch that itch. It’s been his exclusive daily driver since late 2025.

Pi also includes cost tracking from the start — something Mario found other harnesses do poorly. (Claude Code disabled /cost for Max plan users entirely.)

The Actual System Prompt

The following is a historical minimal system-prompt example from the original design account, not the complete current 1.0 prompt or a fixed token budget including arbitrary AGENTS.md files:

You are an expert coding assistant. You help users with coding tasks by reading files,
executing commands, editing code, and writing new files.
 
Available tools:
- read: Read file contents
- bash: Execute bash commands
- edit: Make surgical edits to files
- write: Create or overwrite files
 
Guidelines:
- Use bash for file operations like ls, grep, find
- Use read to examine files before editing
- Use edit for precise changes (old text must match exactly)
- Use write only for new files or complete rewrites
- When summarizing your actions, output plain text directly - do NOT use cat or bash to display what you did
- Be concise in your responses
- Show file paths clearly when working with files
 
Documentation:
- Your own documentation is at: /path/to/README.md

Project context augments the base prompt. In 1.0, structured prompt sections and tool changes can also be recorded during the conversation. The historical design motivation remains: avoid redundant instructions for operations models already understand.

The Four Tools

Pi’s four core file/shell operations are:

read   — Read file contents (text + images). Defaults to first 2000 lines; offset/limit for large files.
write  — Write content to a file. Creates file and parent dirs if needed. Overwrites if exists.
edit   — Replace exact text in a file. oldText must match exactly including whitespace.
bash   — Execute a bash command in the working directory. Returns stdout and stderr.

Pi 1.0 can additionally expose Codemode, tool discovery, native MCP tools, and extension-provided capabilities. The four operations remain the core coding surface, not a limit on the entire available tool loadout.

Why so few tools?

The minimal toolset is not an oversight — it’s the foundation of the self-extension philosophy. If you need the agent to do something it can’t yet do, you have it build the capability. The agent’s tools are sufficient to build any other tool. And models have been trained extensively on these four operations — they don’t need more scaffolding.

Extension System

What Pi lacks in breadth it makes up for in a well-designed extension system:

  • Custom tools: extensions can register new tools for the LLM to call
  • State persistence: extension state is written to disk alongside session data, surviving restarts
  • Hot reloading: the agent writes extension code, reloads, tests, and iterates — all in a loop
  • TUI components: extensions can render custom terminal UI — spinners, progress bars, file pickers, data tables, preview panes. Flexible enough that Mario ran Doom in it.
  • Documentation included: Pi ships with docs and examples so the agent can extend itself without hand-holding

Session Trees

Sessions in Pi are trees, not linear histories. This unlocks a powerful workflow:

  1. You’re mid-session and a tool breaks
  2. Branch — open a side session to fix the broken tool
  3. Fix it, test it
  4. Rewind the main session to before the branch point
  5. Pi summarizes what happened on the side branch
  6. Continue the main session with the fix in place — no context pollution

This also enables clean code review: branch into a fresh review context, get findings, bring fixes back.


The /answer extension reformats the agent’s questions into a clean input box

Deliberate Omissions

Pi’s “no” list is as defining as its feature list. Each omission is a deliberate design decision rooted in Context Engineering and observability:

FeatureDecisionReason
MCPSupported in Pi 1.0Native integration with Codemode and deferred/direct exposure; the earlier rejection is historical
Built-in todosNoModel-tracked state → more errors. Use TODO.md with checkboxes instead.
Plan modeNoOpaque sub-agent loop. Use PLAN.md instead — observable, editable, persistent, versionable.
Background bashNoAdds process tracking complexity. Use tmux: full observability, interactable, native process management.
Sub-agents (default)NoBlack box within black box; poor context transfer; fix the workflow first. Valid exception: code review.
Permission promptsNo (YOLO)Security theater. If the agent can write and run code, arbitrary command execution is already possible.

The file-as-state pattern

For todos and plans, the rule is: use a markdown file. The agent reads and writes it. You co-author it. It persists across sessions, is versionable with git, and you can always see exactly what the agent is working from.

For MCP, the current design uses tool exposure metadata and transcript-aware changes rather than requiring every server tool in the initial prompt. The earlier claim of architectural incompatibility is explicitly withdrawn. CLI wrappers such as mcporter remain an option, not a prerequisite for native access.

Skills vs Extensions

Pi distinguishes two extension modes:

  • Skills: reusable instructions loaded when relevant; distinct from prompt templates and commands even when the UI offers ways to invoke them.
  • Extensions: executable code that can register tools, commands, providers, virtual models, MCP servers, state, and UI. They run with the Pi process’s permissions.

Armin Ronacher’s approach: build both via the agent itself. His agent-stuff repo contains skills the agent built to his specification. He discards skills when they’re no longer needed — no accumulation of dead tooling.

Tip

Use skills for prompting patterns you reuse. Use extensions for behavior you need to code.

The .pi Folder — Pi’s Own Tracker Workflow

Pi’s repository ships a committed .pi folder with the slash commands and extensions the team uses to maintain Pi with Pi. Documented in Building Pi With Pi (2026-05-24):

  • /is (analyze issue) — labels and assigns a GitHub issue, reads the full thread and linked references, then explicitly instructs the agent not to trust the analysis written in the issue and to derive its own diagnosis from the code and execution path. This is a direct defence against slop issues that prime the agent toward the reporter’s wrong root-cause guess.
  • prompt-url-widget — extension that watches the prompt before the agent starts, recognises a GitHub issue/PR URL in the input, fetches title and author via gh, renders a small UI widget, and renames the session. Rebuilds the widget state on session start or switch, so reopened investigations remain visually distinct across many open Pi windows.
  • /wr (wrap it up) — infers GitHub context from the session, updates the changelog, drafts or posts the final issue comment with an AI-disclaimer, commits only the files changed in that session, adds the appropriate closes #... when there is exactly one issue, and pushes from main.

In practice this enables careful parallelism: several Pi windows running /is against different issues, each visually labelled by the widget, then a sequential walk through the investigations. The parallelism is for reproduction and reading, not unattended fixing.

Example Extensions

Built by Pi, to Armin’s specifications, not hand-written by him:

  • /answer — extracts questions from the agent’s last response, reformats as a structured input box
  • /todos — manages task files in .pi/todos; sessions can claim tasks
  • /review — branches into a review context; surfaces new dependencies and other call-outs
  • /control — one Pi agent sends prompts to another; lightweight multi-agent
  • /files — lists all files touched in the session; Quick Look, Finder, VS Code diff integration

Community extensions exist too: Nico’s subagent extension and pi-interactive-shell which lets Pi drive interactive CLIs in an observable TUI overlay.

OpenClaw and Beyond

Pi’s component model is designed to be embedded. OpenClaw — which went viral under several names (ClawdBot, MoltBot) — is Pi connected to a communication channel. Armin Ronacher’s Telegram bot is Pi. Mario Zechner’s “mom” is Pi. The agent can build you a connected variant of itself if you point it at these examples.

Architecture (pi-mono)

Pi is a monorepo of composable packages:

  • pi-ai — unified LLM API: multi-provider (Anthropic, OpenAI, Google, xAI, Groq, Cerebras, OpenRouter), streaming, tool calling with TypeBox schemas, cross-provider context handoff, abort support, split tool results (LLM portion vs UI portion)
  • pi-agent-core — agent loop, state management, message queuing, transport abstraction
  • pi-tui: terminal UI components and rendering. Pi 1.0 announces full-screen mode as the default; the earlier scrollback-only presentation described an older version.
  • pi-coding-agent — the CLI: session management, slash commands, model switching, AGENTS.md loading, HTML export, headless/RPC mode

Local Inference: pi-ds4

Armin Ronacher built pi-ds4 — a Pi extension that embeds Salvatore Sanfilippo’s ds4.c inference engine directly into Pi. It registers ds4/deepseek-v4-flash as a provider, compiles and starts the server on demand, chooses quantization automatically, and shuts down via watchdog when unused. Zero configuration required — the extension treats the entire local inference stack (model loading, prompt rendering, KV caching, tool calls) as a single product surface where any failure is a bug. See Local Models - Focus and Polish for the argument behind this approach.

Install: pi install https://github.com/mitsuhiko/pi-ds4

In the Wild

Lucas Meijer (Unity co-founder) gave a conference talk — A love letter to Pi — that serves as an independent practitioner’s endorsement of Pi. Key observations from an experienced outsider:

  • /tree for context branching is the feature he uses most; pruning dead-end side quests is central to his workflow
  • The 50% context rule: above 50% context fill, agent quality degrades noticeably; Pi’s /tree makes it practical to stay under
  • /answer extension (community-built) as a model for the right way to extend Pi — solve actual friction, not hypothetical problems
  • Pi’s self-extension capability (write an extension, /reload, hot-reload) as an example of “Barba Papa software” — software that morphs to fit the user
  • Prefers Pi over Claude Code for precise context control in a world where nobody yet knows what ergonomic AI assistance looks like

Sources

  • “You Said No MCP!”: September 29, 2026 post explaining the native MCP and codemode decision.
  • Pi 1.0: October 1, 2026 release announcement; native MCP/Codemode, virtual models, deferred loading, caching, prompt transitions, UI changes, and MIT licensing. Checked against the published 1.0.0 documentation on October 3; no feature execution or performance benchmark was performed. Correction added 2026-10-08: Quang’s installed Pi is 0.87.1, so the earlier wording “installed 1.0.0 documentation” was wrong. The check described the release, not his install.
  • Pi Durable: separate experimental framework for long-running applications, with durability and multi-client behavior not automatically inherited by the terminal CLI.
  • Pi: The Minimal Agent Within OpenClaw — Armin Ronacher’s firsthand account of Pi’s design (2026-01-31)
  • What I learned building an opinionated and minimal coding agent — Mario’s deep technical account of building Pi (2025-11-30)
  • I’ve sold out — Mario’s announcement of Pi joining Earendil, governance and licensing details (2026-04-08)
  • Thoughts on Slowing the F*** Down — Mario’s essay on agentic coding discipline
  • A love letter to Pi — Unity co-founder’s practitioner’s-eye view of Pi in production (2026-03)
  • Building Pi With Pi — Armin on dogfooding Pi to maintain Pi; the .pi folder; slop-issue + slop-code patterns; the 90-day tracker numbers (2026-05-24)