Coding Agents/PI

PI

by Earendil Works

cliactivefree

A minimalist open-source terminal coding agent that runs across 15+ LLM providers, with a TypeScript-based Skills system for extensibility and session branching for non-destructive exploration.

PI is an open-source terminal coding agent built around the principle of extensible primitives rather than opinionated workflows. Developers interact with their codebase through a minimal CLI that can read, write, and edit files, run shell commands, and manage multi-file sessions. The agent connects to over 15 LLM providers -- including Anthropic, OpenAI, Google, Mistral, and Ollama -- with mid-session model switching via keyboard shortcut.

Background

PI was created by Mario Zechner, an Austrian software developer best known in the open-source world as the creator of libGDX, the widely-used Java game development framework that has powered thousands of cross-platform games since its inception in 2010. Before building PI, Zechner also created RoboVM, a compiler that brought Java to iOS. His background spans academia, startups, industry, and open-source software, with deep expertise in applied machine learning, compiler engineering, and computer graphics.

The origin of PI grew directly out of frustration with existing coding agents. As AI-assisted development tools proliferated in 2024, Zechner found tools like Claude Code had become unpredictable as new features accumulated -- what he described as "a spaceship with 80% of functionality I have no use for." He wanted full visibility into what was being injected into the model context, the ability to inspect every model interaction, a session format he could actually read, and a foundation he could build alternative UIs on top of. None of the existing tools delivered all four, so he built PI himself.

PI launched publicly on May 18, 2024, under the @mariozechner npm scope. The initial release was deliberately narrow: four tools, a sub-1,000-token system prompt, and a JSONL session format. The project gained rapid community adoption and by early 2026 had accumulated over 60,000 GitHub stars and 7,000 forks, making it one of the fastest-growing open-source AI coding projects. In May 2026 Zechner joined Earendil Works and PI moved under the @earendil-works scope at version 0.74.0 -- marking its first release from its new organizational home.

The philosophy Zechner brought from libGDX carries directly into PI: build the smallest possible correct core, expose clean APIs, and let the community extend everything else. Where libGDX avoided prescribing game loop implementations, PI avoids prescribing workflows. The design maxim is explicit: "if I don't need it, it won't be built."

Key Capabilities

Skills Extension System

The Skills system is PI's primary extensibility mechanism and one of its most distinctive architectural choices. Rather than shipping a large built-in toolset, PI delegates advanced capabilities -- web search, browser automation, calendar access, speech transcription, IDE integration, and more -- to independently installable Skill packages.

Each Skill is a Markdown file (SKILL.md) that defines when to invoke the capability and what steps to follow. Skills carry no compiled code; they are plain-text instruction sets the model reads at the start of a session. This design means skills are portable across agent frameworks: the official pi-skills repository explicitly notes compatibility with Claude Code, Codex CLI, Amp, and Droid, in addition to PI itself.

Skills follow the emerging agentskills.io standard, which separates skill discovery metadata from execution instructions. Teams can publish internal skills for custom workflows -- proprietary APIs, company-specific deployment pipelines, internal documentation retrieval -- without forking PI's core. Installation is scoped: skills can be installed at the user level (always available) or project level (context-specific), and PI discovers them automatically at session start.

Multi-Provider Model Support with Mid-Session Switching

PI's pi-ai package implements a unified LLM API that spans more than 25 providers: Anthropic, OpenAI, Google Gemini, AWS Bedrock, Microsoft Azure OpenAI, Mistral, Groq, Cerebras, xAI, Hugging Face, OpenRouter, and any OpenAI-compatible endpoint including self-hosted Ollama instances. All providers are addressed through the same interface; the developer sets the target in configuration and PI handles the rest.

What distinguishes this is the cross-provider context handoff. Switching models mid-session does not restart the conversation. PI converts the accumulated message history into a provider-neutral format and replays it for the new provider. Provider-specific artifacts -- Anthropic extended thinking traces, proprietary cache tokens, reasoning metadata -- are translated when possible and stripped cleanly when not. The user invokes /model or a keyboard shortcut; the conversation continues without disruption.

This capability matters for real workflows: a developer might open a session with a fast, low-cost model for exploration, switch to a frontier reasoning model for a hard architectural problem, then return to the fast model for implementation -- all within one unbroken session file.

Session Branching and Tree Structure

PI stores sessions as tree-structured JSONL files where each message entry carries an id and a parentId. This structure means branching is not a copy operation -- it is a pointer change within a single file. Developers navigate to any previous point in a conversation using the /tree command and diverge from there; the original thread is preserved and can be returned to at any time.

The practical value is non-destructive exploration. When an agentic edit goes in the wrong direction, the developer does not need to undo file changes and reconstruct context -- they branch before the divergence and try a different approach. Both threads exist simultaneously in the session file and can be compared or continued independently.

Sessions can be serialized to HTML for documentation or shared as GitHub gists with stable URLs. The JSONL format is human-readable and tools-friendly; teams building dashboards or analytics around their AI development sessions can parse session files directly without a proprietary reader.

Minimalist Token-Efficient Design

PI's system prompt and tool definitions together consume under 1,000 tokens. This is intentional and argued from first principles: frontier models are extensively fine-tuned on coding agent patterns and do not require elaborate behavioral scaffolding. Elaborate system prompts consume token budget that could otherwise hold real conversation content or file context.

The lean prompt translates directly to longer effective sessions. In benchmark testing on Terminal-Bench 2.0, PI with Claude Opus performed competitively against Codex, Cursor, and Windsurf -- validating that minimalism does not sacrifice capability. PI also ships with automatic message compaction that activates as sessions approach context limits, preserving the working window without manual management.

The terminal rendering layer (pi-tui) applies a differential rendering model inspired by React's virtual DOM: it calculates what has changed on screen and emits only the necessary escape sequences. The result is a tool that loads instantly and responds without the flickering or redraw artifacts common in other terminal agents.

Autonomy Level

Level 3 -- Supervised agent. PI acts on explicit user instructions and can be interrupted at any point with the Enter key or redirected with a follow-up prompt (Alt+Enter). It does not initiate actions autonomously or run in the background.

Strengths

  • No Docker, Python environment, or build steps required -- install via npm, pnpm, or bun
  • Mid-session model switching across 25+ providers without losing conversation context
  • Session branching and export make exploratory coding non-destructive and reviewable
  • Skills ecosystem enables custom capabilities without forking the core or writing agent code
  • Sub-1,000-token system prompt preserves token budget for actual work
  • Lightweight footprint suitable for constrained environments including Termux and containers
  • Active open-source community with 60,000+ GitHub stars and contributions from teams building on the core

Limitations

  • No built-in MCP support -- MCP servers can be added via Skills packages but require configuration
  • No built-in browser automation or web search -- available via the official pi-skills packages but not included by default
  • No permission or sandboxing system for filesystem and process access -- containerization is the recommended security boundary for untrusted contexts
  • No plan mode or structured task management built in -- file-based planning via AGENTS.md is the intended pattern
  • Terminal-only first-party interface; a web UI component library exists but is not a packaged standalone product
  • YOLO-mode default means developers unfamiliar with agentic coding risk unintended file changes without containerization