Build a Minimal Agent with Bare Pi
Skip the full OpenClaw stack and build a fully-controlled minimal agent directly on Pi, its kernel engine: install, configure models, write your first extension, project-level skills, and session-tree workflows.
Prerequisites
- Node.js 22.19+ (required by Pi)
- One LLM API key (OpenAI / Anthropic / Google, etc.)
- Terminal and CLI basics
- A clear idea of what your agent should do
Steps
Install pi-coding-agent
Pi's interactive coding agent ships as an npm package. Check your Node version, then install globally.
Commands
node -v && npm install -g @earendil-works/pi-coding-agent Tips
- • Pi's supply-chain discipline (pinned deps + shrinkwrap, --ignore-scripts installs) is part of why it has a reliability reputation.
First run and model setup
Run pi in any directory and follow the prompts to add an API key. The pi-ai layer unifies OpenAI / Anthropic / Google and more — switching models never touches your code.
Commands
pi Tips
- • You can switch models mid-session; messages from different providers coexist in one session by design.
Start from official example extensions
The repo ships official example extensions under packages/coding-agent/examples/. Point Pi at one and say 'build me one like this, but...' — far faster than writing from scratch.
Commands
https://github.com/earendil-works/pi/tree/main/packages/coding-agent/examples/ Tips
- • Pi's philosophy is self-extension: instead of downloading community extensions, point the agent at an example and have it remix it for you.
Practice the minimal-extensions principle
Community consensus on r/PiCodingAgent: the fewer extensions, the better Pi works. After each install ask 'is this actually better?' — if not, delete it.
Tips
- • Throw away skills you no longer need too — Armin Ronacher prunes hand-crafted skills regularly.
Turn recurring actions into project-level skills
Keep project-level skills inside the repo so the agent always follows your conventions in that project — teammates get the same behavior on clone.
Commands
https://www.reddit.com/r/PiCodingAgent/comments/1ttv8fu/project_level_skillsextensions_are_op/ Tips
- • The community calls project-level skills 'OP': commit-message style, changelog generation, forcing uv over pip — all great skill or interception-extension material.
Session trees and the self-extension loop
Pi sessions are trees: branch off to fix a broken extension, then return to the main session without polluting its context. Let the agent write the extension → hot reload → test, looping until it works.
Tips
- • Pi can even render custom TUI components (progress bars, file pickers, preview panes) — the author ran Doom in the TUI.