Understanding Fantastic
Coding Agents
A deep technical exploration of how modern AI coding agents work — comparing containment-first, control-first, provider-agnostic product, and extensibility-first designs.
The Agent Loop
Hover on a step to see how each harness moves from prompt to tool execution.
Tool Comparison
Click a cell to see implementation details.
| Capability | Codex CLI | Claude Code | OpenCode | Pi |
|---|---|---|---|---|
| File Search | Shell (rg) Model runs rg via shell command | GlobTool + GrepTool Built-in ripgrep wrappers | grep + glob + list Rich built-in search surface | grep + find + ls Compact built-ins with replaceable backends |
| File Editing | apply_patch Unified diff/patch format | FileEdit Single exact replacement | edit + multiedit + apply_patch Supports multiple edit styles | edit + write Exact replacements with edits[] batching |
| Shell Execution | shell Execute in kernel sandbox | Bash Execute with permission checks | bash Execute with built-in permission rules | bash Straightforward shell tool |
| Customization | Dynamic tools Some dynamic extensibility | Product integrations Rich but product-shaped | Plugins + MCP + custom tools Broad open extension surface | Extensions + SDK First-class customization story |
| Permissions | Guardian Typed approvals + policy rules | Dialogs + YOLO Interactive approval + classifier | Pattern Engine Built-in allow/ask/deny rules | Extension hooks No built-in permission UI |
| Context Management | GhostSnapshot Single main compaction path | Compaction cascade Multiple compaction strategies | Session summaries + prune Hidden summary agents and pruning | JSONL session tree Compaction + branch summaries |
| Multi-Agent | spawn_agents_on_csv Built-in in-process agents | AgentTool Built-in process-based agents | task tool Built-in child-session agents | None built-in Bring your own sub-agents |
Chapters
Overview
What coding agents are, the two agents compared, high-level design philosophies
02Architecture
Language choices, project structure, entry points, build & distribution
03Agent Loop
The core execution cycle — how agents think, act, and iterate
04Tool System
How tools are defined, registered, and executed
05File Search
Finding files and searching code — ripgrep, indexing, and search strategies
06File Editing
How agents modify code — patch-based vs string-replacement approaches
07Sandbox & Security
Kernel sandboxing vs application-level controls
08Permissions
Approval systems, classifiers, and trust models
09Context Management
Conversation history, compaction, and token budgeting
10Prompt Engineering
System prompt construction, templates, and dynamic injection
11Model Integration
API clients, streaming, caching, and provider abstraction
12Multi-Agent
Sub-agent spawning, communication, and coordination
Appendix
APPENDIXAgent Matrix
A side-by-side reference comparing Codex CLI, Claude Code, OpenCode, and Pi across architecture, tools, permissions, context, providers, and multi-agent design.