# "Why I switched to Pi..." <!-- ref: @content/youtube/ai-jason/why-i-switched-to-pi tags: [Pi agent, coding agent harness, extensions, agent SDK, OpenClaw] version: 2 updated_at: 2026-11-22T13:41:40.231Z --> **[Watch on YouTube](https://www.youtube.com/watch?v=MsPhMhfvgD4)** # Why I switched to Pi... *Synthesized from AI Jason, 2026-07-14.* AI Jason presents solo, with a sponsor segment for a free Claude Code guide made with HubSpot at the start. ## Core Thesis AI Jason argues that the Pi agent is one of the best foundations for building agent systems because it is a minimal, fully extensible harness that adapts to the user. Unlike Claude Code or Codex, whose internals cannot be modified beyond a limited hook system, Pi lets users and the agent itself rewrite behavior through extensions. ## Key Insights - **Why the harness matters.** He says Claude Code and Codex are now roughly equivalent, but each has unique features that cannot be transplanted, and their hooks can only add information to tool results rather than rewrite them. Pi was the base of OpenClaw for this reason. - **Minimal core.** Pi ships with only four tools (bash, read, write, edit) and no subagents, agent teams or MCP; everything else is an extension covering tools, context, hooks, session management, commands and UI. - **Self-modifying.** The agent knows how extensions are written; asked for a weather widget it read the docs, wrote the extension, and a reload command brought it live. A package directory offers community extensions such as a goal feature, MCP adapter, Chrome access, scheduling and a Claude-Code-style workflow mode. - **Output filtering example.** A package that intercepts tool output (for example, trimming git log to essentials) reportedly cut tokens by about 96% on that command and 80 to 90% on others. - **Extension examples.** A TypeScript extension that injects git branch, working-tree state and recent commits into the system prompt; a registered clipboard-reading tool; and a permission gateway that uses a small, fast model to check each user message against a permission markdown file and block the session if disallowed. - **Five packages.** AI (multi-model SDK with subscription login), agent (core loop), coding agent (tools, context composition, extensions, SDK), TUI and an experimental orchestrator for scheduled or delegated tasks. - **Building products.** For local agents the coding-agent SDK is nearly enough; for web-hosted ones, store sessions in a database instead of JSONL files and wrap file and bash tools in a per-user sandbox. He built a hosted autonomous-company agent split into 11 agents with an orchestrator, task entities and a tool proxy. ## Actionable Takeaways 1. Start with Pi's four-tool core and add only the extensions you need, from the package directory or by asking the agent to write them. 2. Use a tool-output filter extension to cut token use from verbose commands. 3. For permission control, route each message through a small model against a policy file before the main agent runs. 4. When hosting Pi on the web, move session storage to a database and sandbox the read, write and bash tools per user. ## Notable Quotes > "the harness should actually adapt to the user, not the other way around" — AI Jason --- *Related: `@content/youtube/yifan-bth/the-openclaw-security-settings-i-actually-change` · `@content/youtube/cole-medin/pi-coding-agent-archon-build-any-ai-coding-workflow-no-claude-code-bloat` · `@content/youtube/liam-ottley/claude-managed-agents-will-make-millionaires-do-this-now` · `@content/youtube/liam-ottley/ai-just-had-its-iphone-moment-heres-how-to-win` · `@content/youtube/liam-ottley/openclaw-will-never-actually-run-your-business-try-this-instead`* --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*