Zeitgeist
Between v0.15.0 and v0.21.0 (December 9-14, 2025), pi underwent a rapid feature expansion that touched almost every layer of the stack. The 123 commits -- spanning just five days -- introduced the hooks system, the skills framework, a complete RPC protocol rewrite, Mistral as a new provider, auto-retry on transient errors, inline image rendering, and Mom's migration to AgentSession. This was the stage where pi stopped being a coding agent and became an agent platform: something other programs could embed, extend, and automate.
The speed of development was extraordinary even by pi's standards. The hooks system (v0.18.0) and skills framework (v0.19.0) shipped within two days of each other. Both addressed the same fundamental limitation -- pi's behavior was hardcoded -- but from different angles. Skills were declarative: markdown instruction files loaded on-demand. Hooks were imperative: TypeScript modules subscribing to lifecycle events. Together they formed pi's first extensibility story, letting users customize what the agent knew (skills) and how it behaved (hooks) without forking the codebase.
The RPC rewrite (v0.16.0) was equally significant. The old ad-hoc protocol was replaced with typed JSON commands and an RpcClient class, making pi embeddable in other applications. Combined with the new hooks and the existing web UI, pi could now serve as the backend for custom developer tools -- a vision that the SDK would later formalize.
Key Developments
The Hooks System
Commit 04d59f31 implemented the hooks system and 7c553acd added pi.send() for external message injection, together forming the core of pi's extensibility (#145). Hooks were TypeScript modules auto-discovered from ~/.pi/agent/hooks/*.ts and .pi/hooks/*.ts, exporting a default function that received a HookAPI object. The event model was comprehensive from the start: session_start, session_switch, agent_start, agent_end, turn_start, turn_end, tool_call (with blocking capability), tool_result (with modification capability), and branch. Hooks also got UI primitives -- ctx.ui.select(), ctx.ui.confirm(), ctx.ui.input(), ctx.ui.notify() -- so they could prompt users interactively. The pi.send() API let external processes (file watchers, CI systems, webhooks) inject messages into the running agent session, turning pi into an event-driven system.
The Skills Framework
The skills system (#169, commit 09bca967) took the opposite approach: instead of imperative code, skills were markdown files with YAML frontmatter containing a description field. The agent saw skill names and descriptions in the system prompt and could load them on-demand using the read tool. Discovery was deliberately cross-compatible: pi scanned ~/.codex/skills/, ~/.claude/skills/, and ~/.pi/agent/skills/, so users could share skills across multiple coding agents. The convention changed from any *.md file to SKILL.md inside a directory (3b2b9abf, v0.20.0) to match Codex CLI's format. Skills were displayed on startup (03c404c1) and could be disabled with --no-skills or skills.enabled: false.
RPC Protocol Rewrite
Version 0.16.0 (3559a43b) completely redesigned the RPC mode with a typed protocol, replacing the informal message format from earlier versions. The new protocol included an RpcClient TypeScript class, proper tool call correlation, and documented message types. The get_messages command (3c8ab028) let external clients query the full conversation state. This breaking change (#91) reflected a maturing understanding of pi as infrastructure -- if other programs were going to build on pi's agent runtime, the protocol needed to be stable and well-documented.
Compaction Overhaul
The compaction system was significantly simplified in v0.17.0 (a38e6190). Proactive compaction -- aborting mid-turn when approaching the threshold -- was removed entirely. The new flow had only two triggers: overflow error from the LLM (compact and auto-retry via Agent.continue()) or threshold crossed after a successful turn (compact without retry). This was a philosophical correction: the earlier system was too clever, aborting work the user had waited for. The simpler version let the agent finish its thought, then dealt with context pressure afterward. In-memory branching (82269750) also landed, making --no-session mode fully functional.
Mom's AgentSession Migration
Commit 3f6db8e9 rewrote Mom to use AgentSession for context management, replacing her bespoke message handling. This was the first real validation of the AgentSession abstraction -- if it could power both an interactive TUI and a headless Slack bot, the abstraction was right. The migration required careful work on message synchronization (ca23ade9), duplicate logging prevention (cc71c0a4, e513127b), and attachment handling (e3576fe0). Mom also got an events system (d6809328) for scheduled wake-ups, letting her run periodic tasks without user prompting -- a pattern that foreshadowed the cron-like automation in later stages.
Inline Image Rendering
PR #177 (9e9d5c94, by @nicobailon) added inline image rendering for terminals supporting Kitty graphics protocol or iTerm2 inline images. The implementation queried terminal cell dimensions on startup (215c1066) to preserve aspect ratios, fell back to text placeholders on unsupported terminals, and provided a /show-images toggle command (f68a933d). This was the first time pi rendered anything other than text in the terminal -- a capability that became increasingly important as vision-capable models proliferated.
Philosophy Shifts
The hooks documentation at v0.21.0 revealed how pi thought about extensibility: hooks could intercept and modify but never replace core behavior. A tool_call hook could block execution or modify parameters, but it could not change how the agent loop worked. A tool_result hook could transform output before the LLM saw it, but the tool itself still ran normally. This interception model was deliberately conservative -- it let users add safety rails and integrations without risking the agent's fundamental reliability.
The skills system's cross-compatibility with Claude Code and Codex CLI was equally revealing. Pi explicitly chose not to invent a proprietary skill format. By scanning competitors' directories, pi reduced switching costs and let users build a shared skill library across tools. AGENTS.md also evolved in this stage to document attribution format for external contributions (38119ffb), reflecting a growing contributor community.
Looking Forward
The hooks system was the seed for everything that followed in Stages 5 and 6. Custom tools (Stage 5) would emerge as a natural extension -- if hooks could intercept tool calls, why not define entirely new tools? The SDK (Stage 5) would formalize the programmatic access that the RPC rewrite hinted at. And the eventual unification of hooks and custom tools into the extensions system (Stage 6) resolved the awkward split between two extensibility mechanisms that this stage introduced. Mom's events system for scheduled wake-ups planted the idea that agents could be autonomous, not just reactive -- a theme that would develop as pi matured.