Understanding Fantastic
Coding Agents
A deep technical exploration of how modern AI coding agents work — from architecture to implementation details.
The Agent Loop
Hover on a step to see what happens underneath
Tool Comparison
Click a cell to see implementation details
| Capability | Codex CLI | Claude Code |
|---|---|---|
| File Search | Shell (rg) Model runs rg via shell command | GlobTool + GrepTool Built-in ripgrep wrappers with rich params |
| File Editing | apply_patch Unified diff/patch format | FileEdit String replacement (old→new) |
| Shell Execution | shell Execute in kernel sandbox | Bash Execute with permission checks |
| Web Access | Shell (curl) Via shell commands | WebFetch + WebSearch Dedicated tools with AI processing |
| Multi-Agent | spawn_agents_on_csv In-process agents with forked history | AgentTool Separate child processes |
| Code Intelligence | — | LSPTool Language Server Protocol integration |
| Permissions | request_permissions Model can request new permissions | Permission Dialog Interactive approval + LLM classifier |
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