Skip to content

Instantly share code, notes, and snippets.

@rajeshpv
Created March 24, 2026 17:35
Show Gist options
  • Select an option

  • Save rajeshpv/eccc1dc8d70e8cdcf948de3312ca111f to your computer and use it in GitHub Desktop.

Select an option

Save rajeshpv/eccc1dc8d70e8cdcf948de3312ca111f to your computer and use it in GitHub Desktop.

pi.dev — How It Differs from Other AI CLI Tools

What Is pi.dev?

Pi is a minimal, terminal-based coding agent by Mario Zechner (creator of libGDX). Open source (MIT), installed via npm install -g @mariozechner/pi-coding-agent.

Core Philosophy

"Adapt pi to your workflows, not the other way around."

It's the "Unix philosophy" coding agent — a small, extensible harness with just 4 built-in tools (read, write, edit, bash), and everything else is user-composable.


How It Works

Pi gives the LLM four built-in tools and runs in four modes:

  1. Interactive — full TUI experience
  2. Print/JSONpi -p "query" for scripting, --mode json for event streams
  3. RPC — JSON protocol over stdin/stdout for non-Node integrations
  4. SDK — embeddable in your own apps via TypeScript API

Key Differences from Claude Code, Cursor, Copilot, Aider

Feature Pi Claude Code Cursor / Copilot
Model support 15+ providers (Anthropic, OpenAI, Google, Mistral, Ollama, etc.) — switch mid-session Anthropic only Mostly tied to vendor
Extension system Full TypeScript extension API — replace tools, add commands, custom TUI Hooks + MCP Plugin/extension based
Package ecosystem pi install npm:... / pi install git:... for sharing skills, extensions, themes No marketplace No marketplace
Sub-agents Build your own (spawn pi instances via tmux) Built-in Agent tool Built-in
Permissions None by default — use containers or build via extensions Built-in permission system IDE-integrated
Plan mode Write plans to files, or build via extension Built-in Built-in
MCP support Not built-in — use "Skills" (CLI tools + READMEs) instead Built-in Varies
Session model Tree-structured — branch/fork from any point Linear history Linear

Aggressive Extensibility Over Built-in Features

This is the central difference. Where Claude Code, Cursor, and Copilot bake in features like sub-agents, plan mode, permission popups, MCP support, and background bash, pi intentionally omits all of these from the core and instead provides primitives to build them yourself:

  • No MCP — Use "Skills" (CLI tools with READMEs) instead, or write an extension that adds MCP
  • No sub-agents — Spawn pi instances via tmux, or build your own via extensions
  • No permission popups — Run in a container, or build custom confirmation flows via extensions
  • No plan mode — Write plans to files, or build it with extensions
  • No built-in to-dos — Use a TODO.md file
  • No background bash — Use tmux directly

All of these are available as example extensions (50+ examples provided), so users can adopt them if desired.

Model Agnostic — 15+ Providers, Hundreds of Models

Unlike Claude Code (Anthropic-only) or GitHub Copilot (tied to GitHub/OpenAI), pi supports Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi, MiniMax, OpenRouter, Ollama, and more. You can switch models mid-session with /model or Ctrl+L, and cycle through favorites with Ctrl+P. Custom providers can be added via config or extensions.

Package Ecosystem

Pi has a package system for sharing extensions, skills, prompt templates, and themes. This is more like a plugin marketplace model — something none of the major CLI agents (Claude Code, Aider) offer in a structured way.

Tree-Structured Sessions

Sessions are stored as tree structures in JSONL files. You can use /tree to navigate to any previous point in a conversation and branch from there. All branches live in a single file. This is more sophisticated than the linear session history in most competing tools.

Context Engineering Philosophy

Pi takes a "context engineering" approach with a deliberately minimal system prompt and multiple layers of control:

  • AGENTS.md / CLAUDE.md — project instructions loaded at startup
  • SYSTEM.md — replace or append to the default system prompt per-project
  • Skills — on-demand capability packages (progressive disclosure without busting prompt cache)
  • Prompt Templates — reusable Markdown prompts expanded via /name
  • Dynamic context via extensions — inject messages before each turn, filter history, implement RAG, or build long-term memory
  • Customizable compaction — auto-summarizes older messages when approaching context limits; fully overridable

Message Queuing / Steering

You can submit messages while the agent is working: Enter sends a steering message (interrupts after current tool), Alt+Enter queues a follow-up (waits until agent finishes). This is a unique UX feature not found in most competitors.


Strong Points for Software Development Workflow

  1. Low lock-in: Model-agnostic, open source MIT, no vendor dependency
  2. Scriptable: Print mode (pi -p "...") and piped stdin make it easy to integrate into CI/CD, shell scripts, and automation
  3. Embeddable: SDK and RPC modes let you build pi into other applications
  4. Customizable tools: You can replace or augment built-in tools (read, write, edit, bash) — e.g., add grep, find, ls, or entirely custom tools
  5. Per-project configuration: .pi/settings.json, .pi/extensions/, .pi/skills/ allow project-specific agent behavior
  6. Session management: Continue (-c), resume (-r), fork, and branch sessions; export to HTML or share via GitHub gist
  7. Thinking level control: Cycle through off/minimal/low/medium/high/xhigh with Shift+Tab, with editor border color indicating current level
  8. OAuth login support: Use existing subscriptions (Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot, Google Gemini CLI) rather than just API keys
  9. File references with @: Fuzzy-search project files inline in the editor
  10. Image support: Paste images with Ctrl+V or drag onto terminal
  11. Shareable sessions: Export to HTML or upload to GitHub gist with a rendered shareable URL
  12. Cross-platform: Supports macOS, Linux, Windows, and even Termux on Android

Architecture and Technical Approach

  • Runtime: Node.js / TypeScript
  • Package: @mariozechner/pi-coding-agent on npm
  • Monorepo structure with three core packages:
    • @mariozechner/pi-ai — core LLM toolkit
    • @mariozechner/pi-agent — agent framework
    • @mariozechner/pi-tui — terminal UI components
  • Extension API: TypeScript modules that receive an ExtensionAPI object with access to tools, commands, keyboard shortcuts, events, and TUI rendering
  • Session storage: JSONL files with tree structure (id/parentId), stored in ~/.pi/agent/sessions/ organized by working directory
  • Follows the Agent Skills standard (agentskills.io) for skill definitions

Trade-offs

Strength Trade-off
Minimal core More barebones out-of-the-box — you build what you need
No built-in permissions Must use containers or build your own guardrails
No MCP Must use Skills pattern or write extensions
Extension-heavy approach Requires TypeScript knowledge for deep customization

Bottom Line

Pi is for developers who want full control over their AI coding workflow and are willing to invest in customization. Claude Code and Cursor give you more out-of-the-box; Pi gives you more composability and zero vendor lock-in. Think of it as the "Vim of AI coding agents" — powerful once configured, but requires setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment