Anatomy of an AI Coding Agent
summary
Code-level walkthrough of OpenCode vs Claude Code: both use streaming tool execution, rebuild a full transcript each step, and trade off frontloaded guidance (Claude Code sends ~16,600 tokens) versus leaner prompts (OpenCode ~7,400). Permissions differ: rule-based allow/deny in OpenCode vs a classifier “auto” mode in Claude Code. A 40-run experiment across four trapped tasks shows both agents reach correct fixes nearly identically, and swapping to a smaller model changes behavior more than changing the harness — highlighting context engineering and sub-agent routing as the real levers.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 1:30What is an AI coding agent
- 2:57Model vs agent architecture
- 4:47The agent loop explained
- 8:24Who controls the loop
- 10:12Tools as agent limbs
- 13:29Routing and model optimization
- 15:40Tool definitions and context
- 17:49Context management failures
- 19:35Context engineering layers
- 22:07Frontloading guidance
- 23:37Context compaction
- 24:41Long-term memory
- 26:06Permission rules
- 28:14Auto mode safety
- 30:21Undo and rollback
- 31:46Harness evolution
- 32:31Experiment setup
- 34:19Results and model impact
- 37:07Swapping the model
- 39:58Harness influence today
- 41:02What you control
