# Why I switched to Pi...

## Executive summary

The video provides a deep technical comparison of coding agents, arguing that Pi Agent offers superior flexibility for building complex agentic systems compared to competitors like Cloud Code and CodeX. Its core strength lies in its 'extension' system, which allows users to programmatically modify the agent's entire harness—including tools, contexts, hooks, and even the UI—making it ideal for advanced build engineering projects and product development.

## Key takeaways

- Pi Agent's Core Advantage: Unlike other agents where modifications are limited by their SDK/CLI structure, Pi Agent's design philosophy allows the harness to adapt to the user. This flexibility enables deep customization across tools, contexts, and hooks.
- Extensibility and Customization: Pi Agents can be extended using new extension files (written by humans or agents) to add custom tools (e.g., clipboard access), modify system prompts, or implement complex logic like permission gates.
- Advanced System Building: The Pi Agent SDK can be used not just as a coding agent but as an entire product scaffold. This includes packages for the AI SDK, agent loop management, and task scheduling (upgrader package), enabling the creation of complex, autonomous systems like 'Post AI'.
- Web Deployment Considerations: When deploying a Pi Agent to a web-hosted environment (non-local file system), developers must manually manage session state and wrap default tools (like `read` or `bash`) within user-specific sandboxes, even if using the SDK.

## Technical details

- Agent Comparison & Limitations: While Cloud Code and CodeX are powerful, their unique features (e.g., dynamic workflow) cannot be easily ported to the other's harness. Furthermore, competitors' hook systems often only allow appending new information rather than directly modifying tool call results.
- Pi Agent Extension System: The extension system allows modification of tools, contexts, hooks, and the UI. Users can write programmatic behavior (e.g., implementing a permission gate using a small LLM model like Haiku) by defining extensions in a `.pi` folder.
- Custom Tooling & Context Management: Developers can register custom tools using `pi.register_tool` (e.g., reading the clipboard). Contextual awareness, such as tracking Git status, is achieved by writing an extension that runs a command and modifies the system prompt before agent start (`pi.on_before_agent_start`).
- Pi Agent SDK Packages: The Pi ecosystem includes specialized packages: `AI package` (for LLM calls/OAuth), `agent package` (the agent loop), `coding agent` (core tooling and session management), and `upgrader package` (for scheduling/delegating tasks).

## Practical implications

- For build engineers designing complex AI products, Pi Agent's modular extension system allows for fine-grained control over the agent runtime, moving beyond simple prompt engineering.
- The ability to wrap core tools (like `bash` or file I/O) in custom sandboxing layers is crucial when migrating local agent logic to a web-hosted, multi-tenant environment.
- Understanding the difference between an LLM SDK (`AI package`) and an agent loop SDK (`agent package`) is necessary for architecting scalable AI applications.

## Topics

Agentic Systems, Coding Agents, Software Architecture, LLM Integration, Extension APIs, System Design, Github repo for pi setup & plugin, Cloud Code Playbook (HubSpot)

Source: https://www.youtube.com/watch?v=MsPhMhfvgD4
