thumbnail

I Created the Ultimate Coding Agent by Combining Pi, Codex, and Claude Code

Ben Davis · 30:35
I Created the Ultimate Coding Agent by Combining Pi, Codex, and Claude Code
🤖 AI Coding Agents 🧩 Pi Extensions 🔀 Multi-Model Orchestration ⚡ Sub-Agents 🏗️ Dev Workflow 🎯 GPT-5.6 + Fable
▶ 0:00

What is Pi & The Extension Philosophy

Ben Davis opens by explaining his return to Pi after exploring T3 Code, Codex, and Claude Code. What brought him back is Pi's radical minimalism and its powerful extension system that lets you build on top of it.

Pi's Minimalist Core

  • 4 tools only — Pi ships with just four built-in tools, deliberately keeping the core tiny
  • Tiny system prompt — minimal instructions to the model, avoiding prompt bloat
  • Robust TUI — a polished terminal user interface that stays out of your way

The "What We Didn't Build" Philosophy

Pi.dev takes a strong stance on what they intentionally excluded from the core product:

  • ❌ No MCP (Model Context Protocol)
  • ❌ No sub-agents
  • ❌ No permission pop-ups
  • ❌ No plan mode
  • ❌ No to-dos
  • ❌ No background bash

The key insight: the extension system lets you add everything back in. Extensions are written in TypeScript and can be configured globally or per-project. Ben's Pi looks nothing like stock Pi — it's fully customized through extensions he's built and shared.

▶ 2:00

UI & Simple Extensions

Ben walks through several simpler extensions that improve daily usability, starting with visual and utility customizations.

UI & Info Extensions

  • Git info — shows current branch, status, and repo context
  • Model info — displays which model is active
  • GitHub Dark Default theme — UI customization for comfortable dark mode

/copyall Slash Command

Copies all messages in the current conversation to clipboard — invaluable for pasting context into other agents when you need to hand off work or get a second opinion.

Firecrawl Search Extension

Adds crawl, search, and scrape tools to Pi. This is the only extension that requires an API key — everything else runs locally. Gives the agent the ability to research the web during development.

Pi is Self-Customizable

Pi's system prompt includes the path to the Pi installation and full documentation. The agent can read the extension spec and modify its own extensions — it's genuinely self-improving.

Ben's recommendation: don't copy-paste his setup. Instead, point your Pi at his repo and let the agent pick which extensions to install and how to configure them for your workflow.

▶ 5:20

Ask User & Background Terminals

Ask User Extension

Provides a multiple-choice tool for the model to ask clarifying questions during planning. Instead of the agent guessing or making assumptions, it presents you with options and lets you steer before it commits to a direction.

Background Terminals Extension

This extension provides a first-class experience for starting and managing terminals in the background — something the default Pi deliberately omits.

  • /ps command — shows all running background terminals at a glance
  • View output of any background process
  • Switch between stdout and stderr views
  • Kill processes directly from the UI
I consider this better than Claude Code or Codex background terminal experiences.
▶ 7:30

File Search Extension

Adds ripgrep (rg) and fd as first-class tool primitives available to the model, replacing the weaker built-in find and grep commands.

  • Auto-installs binaries if not present on the machine
  • Places binaries in a git-ignored bin directory within the Pi config folder
  • Significantly better file search and content search compared to built-in alternatives
  • The model can use structured ripgrep queries instead of piping shell commands together
▶ 7:55

The Workflow System

Inspired by Claude Code's dynamic workflows primitive, Ben built a full workflow orchestration system as a Pi extension. This is where things get serious.

How Workflows Work

  1. Define a big task — describe what you want to accomplish
  2. Break into phases — reconnaissance, implementation, review (or custom phases)
  3. N agents per phase — each phase can spawn multiple agents working in parallel
  4. Results cascade — planning phase outputs feed into implementation, which feeds into review

Under the Hood

  • Each phase has input/output schemas for structured data flow
  • The system writes JavaScript code to orchestrate phases, prompts, and inputs
  • Custom UI visualizes workflow progress — phases go green when complete
  • Built by GPT-5.6 Saul and Fable models reading Pi's extension specification
Extension system in Pi is one of the best I have ever seen. Some of the best software I've used in a very long time.

Ben self-describes this as the "most half-baked" of all his extensions, but notes it's still very usable for big real-world tasks — a testament to how powerful Pi's extension API is.

▶ 11:15

The Sub-Agent System — The Core Innovation

This is the crown jewel of Ben's setup: a sub-agent system that can spawn agents not just in Pi, but also in Codex and Claude Code simultaneously.

Model Routing by Harness

A dedicated skill file tells Pi which models and harnesses to use for each sub-agent type:

Codex

GPT-5.6 Saul on high reasoning

Claude Code

Fable on high reasoning

Pi

Whatever parent thread uses

Sub-Agent Management UI

  • /subagents command — view all running sub-agents
  • See real-time outputs from each agent
  • Send follow-up messages to running agents
  • Kill agents that are going off track
  • When finished: sends message back to original thread OR model calls sub_agent_wait tool

Claude Code SDK Workaround

An important detail: you can't use your Claude Code subscription directly inside Pi's harness (it's against the ToS). However, the Claude Code SDK is allowed, which gives Ben access to Fable usage through the SDK within Pi's sub-agent system.

Real-World Example: YouTube Analytics CLI

Ben built an entire YouTube Analytics CLI tool in a single session using the sub-agent system:

  1. Codex sub-agent researched the YouTube API (~7 minutes)
  2. Pi sub-agent (GPT-5.6 Saul) did the implementation
  3. Claude Code Fable sub-agent prepped the release — webpage, install script, readme, git repo
  4. Main thread used GPT-5.6 on medium reasoning (fast, cheap) while delegating heavy work to sub-agents
The main orchestrator thread stays on fast/cheap medium reasoning while expensive high-reasoning work is delegated to specialized sub-agents — optimal cost and speed balance.
▶ 16:30

The Hybrid Model Strategy

Ben's key insight is that GPT-5.6 and Fable complement each other — their strengths cover each other's weaknesses. By routing tasks to the right model, you get the best of both worlds.

Task-to-Model Routing

🖥️ Computer Use

Codex
Best browser & mobile sim

📐 Architecture

Fable
Planning & beautiful code

⚙️ Grunt Work

Codex
Long-running, reliable

🔧 Quick Changes

Pi Sub-Agent
Testing & menial tasks

The main thread runs GPT-5.6 on medium reasoning — it's fast and cheap, acting as an orchestrator that delegates heavy lifting to specialized sub-agents.

I can just weave all of these together, get the strengths of one without the weaknesses of another.

Ben notes this cross-agent orchestration is possible with other harnesses (e.g., skills for Codex to spawn Claude sub-agents via CLI), but the Pi extension system makes it a first-class, integrated experience.

▶ 18:40

Building Philosophy — The Pottery Analogy

Ben shifts from tools to philosophy, sharing how his actual development process works with these agents.

In-the-Loop Development

  • Pi and Zed editor run side by side — Ben reads code rather than writing it
  • Pi extensions were built with Effect v4 — complex state machines that the models generate
  • Even his Zed editor configuration (keybindings, settings) was customized by a Pi agent
You really don't need to handwrite code for anything other than maybe a one-liner or markdown files.

But there's a crucial caveat: reading and understanding code is still critical.

When Models Get It Wrong

The first implementation of Effect code by Fable + GPT-5.6 was terrible:

Try-catch statements nested together with Effect generators being run within async functions.

The Fix Pattern

  1. Copy the bad function into Pi
  2. Write exactly what's wrong with it
  3. Spawn a sub-agent to research Effect v4's platform docs
  4. Fix one function correctly as a reference implementation
  5. Use that reference to pattern-match corrections onto all other functions

🏺 The Pottery Analogy

Start with a vague shape that's kind of correct, then slowly mold it back and forth until you create what you want. Software development feels like this now.

The first agent pass produces something that mostly works but needs refinement. You shape it iteratively — adding constraints, fixing patterns, steering direction — until the final form emerges.

The "Uncanny Valley" of Coding

  • Tab-completing — feels good, natural augmentation
  • Cursor Command-K function-by-function — awkward middle ground
  • Full agent loops — feels good again, proper delegation

/btw Extension

A clever addition: fire off a background research question while the main task continues. The agent investigates asynchronously and delivers results when ready, without interrupting your flow.

▶ 25:05

The Full Tool Arsenal

Ben reveals the full picture of how he uses three different tools for three different contexts:

Pi CLI — General Purpose

  • General computer management
  • One-off builds (e.g., building a Go YouTube CLI — doesn't even review the code)
  • The orchestration hub for sub-agents across all harnesses

Codex Desktop App — Computer Use

  • Browser automation and GUI interaction
  • Dealing with complex dashboards (GCP console, API key management)
  • Best-in-class computer use capabilities

T3 Code Web App — Long-Running Remote

Ben runs T3 Code on his Linux home server accessed via Tailscale:

  • URL points to a device on the network, not localhost
  • Can close your laptop and jobs keep running on the server
  • Ideal for web dev: spin up a dev server, share via Tailscale, make changes remotely
  • Example: overnight synthetic Svelte data generation on home server, auto-sent to 5090 machine for training
Basically the best remote experience I've had — better than Cursor/Devin for long-running background work.
▶ 27:10

The Future of AI-Assisted Development

Ben closes with reflections on where things are heading and what's genuinely different about the current generation of models.

Models Have Crossed a Threshold

  • Corrections are now stylistic and architectural, not syntactic
  • You can steer mid-generation without stopping: "Hey, you're going down the wrong path, do this instead"
  • Compaction is invisible — can change direction after 30 minutes and 3 compactions without losing context
  • Both GPT-5.6 and Fable are remarkably steerable
Coding is not solved — but the things we correct are very different from before.

Predictions

  • The industry will slide toward T3 Code-like async experiences — one prompt triggers hours of autonomous work
  • Uncertainty about what GPT-6 and Fable 7 will change about current workflows
  • Workflows are constantly changing, and our understanding of software development is evolving with them

Key Takeaways

Pi's extension system enables building a unified orchestration layer over multiple coding agents
Sub-agents across Pi/Codex/Claude Code let you leverage each model's unique strengths simultaneously
The hybrid model strategy (GPT-5.6 for speed + Fable for quality + Codex for computer use) eliminates single-model weaknesses
Reading code > writing code — models write, humans architect and steer
The "pottery analogy" — start rough, mold iteratively; first pass works but needs refinement
Long-running remote sessions on dedicated hardware are becoming essential for complex projects
Workflows and sub-agents are the missing pieces that Pi's minimal design intentionally leaves for users to implement

Resources & Links

  • 🔗 Pi Agent — The minimal coding agent with the powerful extension system
  • 🔗 Ben's Pi Setup — All extensions shown in this video, open source on GitHub
  • 🎬 Watch the Full Video — Ben Davis on YouTube (30:35)