Pi — Terminal AI Coding Agent
Complete guide to pi, Mario Zechner's minimal terminal coding agent. Covers installation, prompt engineering, context files, skills, and the lean-harness philosophy.
Pi — Terminal AI Coding Agent
Pi is Mario Zechner's (Earendil Inc.) minimal terminal coding agent harness. It ships with four built-in tools (read, bash, edit, write — plus grep, find, ls) and a system prompt of roughly 300 words, making it one of the leanest agents available.
The design principle is explicit: pi keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages. No built-in MCP, sub-agents, permission popups, or plan mode — you build or install those.
Navigation
- Prompt Engineering — Context files, system prompts, slash commands, prompt patterns
- Pi Coding Agent (Agents Section) — Platform overview and ecosystem
Quick Start
# Install pi
curl -fsSL https://pi.dev/install | bash
Run a prompt in your project:
cd my-project
pi "Review the auth middleware for security issues"
Pi loads AGENTS.md or CLAUDE.md at startup — from ~/.pi/agent/AGENTS.md (global), walking up from the working directory, and the current directory. Write dense, command-oriented conventions there so every session starts with your project's context.
What Makes Pi Different
- Minimal core — four built-in tools and a ~300-word system prompt. Everything else is opt-in.
- Extensions & skills — workflow-specific behavior lives in extensions, skills, and prompt templates, not in prose.
- Tool allowlists —
--tools read,grep,find,lsscopes the agent to safe, read-only work in one flag. - Message queueing — queue steering and follow-up messages while the agent is working, like live pairing.
- Context files — persistent
AGENTS.mdconventions per project, loaded automatically. - System prompt files — replace or append to the default prompt with
.pi/SYSTEM.mdor~/.pi/agent/SYSTEM.md.
Core Workflows
| Command | What it does |
|---|---|
pi -p "prompt" | Run a single prompt non-interactively |
pi @code.ts @test.ts "prompt" | Scope context to specific files |
pi --tools read,grep,find,ls | Restrict to read-only analysis |
pi --no-context-files | Disable AGENTS.md loading |
/resume | Pick from previous sessions |
/compact [prompt] | Compact context, optionally with custom instructions |
/templatename | Expand a prompt template into the editor |
/skill:name | Invoke a skill directly |
Frequently Asked Questions
Related Resources
- Prompt Engineering in Pi — context files, system prompts, slash commands, prompt patterns
- Pi Coding Agent (Agents Section) — platform overview and ecosystem
- Agent Skills (Agents Section) — cross-tool SKILL.md standard
- Jcode Prompt Engineering — the batteries-included alternative
- Tool Comparison — jcode vs pi vs opencode vs Claude Code
Related Articles
Sandboxed Code Execution for AI Agents with MicroPython + WASM
Step-by-step tutorial on building a safe code-execution tool for AI agents using MicroPython compiled to WebAssembly. Covers installation, one-shot and persistent sessions, resource limits, host functions, and integration into agent tool loops — with working code you can copy and run.
Prompt Engineering in Antigravity CLI
Effective prompting strategies for Antigravity CLI. Multi-model routing, system prompts, context management, hooks, subagents, and agent skills.
AI Coding Tool Comparison — Which One Should You Use?
Detailed comparison of Claude Code, OpenCode, Gemini CLI, Cursor, GitHub Copilot, jcode, and pi. Pricing, context windows, MCP support, prompt patterns, and decision guide for every stack.