The Dumb Loop Wins: Claude Code's Architecture Is the Agent Blueprint
The Architecture That's Boring on Purpose
Claude Code's orchestration layer is a while loop and a message list. That is the trick. No DAG. No typed blackboard. No supervisor routing to specialists. The model plans. Tools are the only structured surface. The orchestrator appends messages, enforces a token budget, and stops when the model says it's done. Multiple independent sources this week landed on the same result: teams that shipped complex orchestration frameworks are deleting them.
Everything that used to be a node becomes a tool. Everything that used to be a routing decision becomes a system prompt. The code that remains is the code you would have had to write anyway: auth, rate limiting, logging, a kill switch.
Where the Intelligence Actually Lives
The loop is boring because six surrounding layers do the real work:
- Context compression: Structured extraction at 95% window capacity. File paths, code snippets, error histories. Explicitly not conversation summarization. Research this week confirmed summarization degrades agent performance below zero-memory baselines, because the summarizer hallucinates.
- Prompt caching: Stable prefixes (system prompt, tool schemas, project context) cached at 10% of original token cost. A 20-turn session drops effective cost by roughly 50%. The discipline is simple: stable content first, volatile content last.
- Multi-agent isolation: Git worktrees for concurrent work plus JSON files on disk for coordination. No message broker. Subagents cannot spawn children or communicate laterally.
- SKILL.md: A markdown file in a folder. Progressive disclosure. The model reads the header eagerly and loads the rest only when the skill is selected. The third primitive, sitting between prompts and tools.
The Tool Layer Is Where Agents Actually Fail
Across production reports, most agent failures land in the tool layer, not reasoning. Six tool calls at 95% each gives 73% end-to-end before the model does anything wrong. One team's logs said "hallucination." The trace said "timeout on call three, silent retry, stale result returned on call four." Those are not the same sentence.
Wix validated this across 250 evaluations: agent-optimized documentation beat custom skills because skill staleness causes catastrophic failures, not graceful degradation. Discord's Rust-based Scylla Control Plane applied the same principle with idempotent tasks, explicit safety conditions, and configurable parallelism. Standing up shadow clusters went from 36 hours to under 2.
Two Caveats
The dumb loop assumes a model that is actually good at tool use and self-correction under long context. On a weaker model the loop stalls or wanders. And if you owe a regulator replayable, auditable, step-for-step behavior, the DAG was not overengineering. It was the spec. Know which one you're building.
The Anti-Pattern: Memory Consolidation
Rewriting episodic memory into summaries degrades performance below zero-memory baselines. Here's what actually happens: the summarizer hallucinates, those hallucinations get retrieved as authoritative memory, and the agent reasons from a confidently wrong summary. The fix is to keep raw episodic logs, retrieve with vector search, and treat summaries as a cache that has to prove it's correct.
What to do
Audit your agent prompt structure to maximize prefix caching — move all stable content (system instructions, tool definitions, persona) to the front, volatile content to the back
Instrument per-tool success rate, median latency, and p99 latency before touching the prompt again
Prototype a /skills directory with SKILL.md files for your 3 most common agent workflows
If running agent memory consolidation, benchmark against raw append-only episodic retrieval on your specific workload