Architectural Layers
Five orthogonal concerns that compose into a complete agent
L1 Tools & Execution
What the agent CAN do. The foundation: tools give the model capabilities to interact with the world.
The Agent Loop
Bash is All You Need
The minimal agent kernel is a while loop + one tool
Tools
One Handler Per Tool
The loop stays the same; new tools register into the dispatch map
MCP
Standard Tool Protocol
MCP is USB for AI tools β standardized discovery and invocation across any service
Think Tool
A Tool That Does Nothing
The simplest tool can be the most useful; giving the model permission to pause improves quality
Tool Design
ACI Principles
Good tools are hard to misuse; tool design impacts agent quality more than prompt design
L2 Planning & Coordination
How work is organized. From simple todo lists to dependency-aware task boards shared across agents.
TodoWrite
Plan Before You Act
An agent without a plan drifts; list the steps first, then execute
Subagents
Clean Context Per Subtask
Subagents use independent messages[], keeping the main conversation clean
Skills
Load on Demand
Inject knowledge via tool_result when needed, not upfront in the system prompt
Tasks
Task Graph + Dependencies
A file-based task graph with ordering, parallelism, and dependencies -- the coordination backbone for multi-agent work
Workflow Patterns
Five Orchestration Strategies
Don't build agents β build workflow patterns; start simple, add complexity only when needed
Long-Running Harness
GAN-Style Three Agents
Separate the generator from the evaluator; fresh context per iteration solves context anxiety
L3 Memory Management
Keeping context within limits. Compression strategies that let agents work infinitely without losing coherence.
L4 Concurrency
Non-blocking execution. Background threads and notification buses for parallel work.
L5 Collaboration
Multi-agent coordination. Teams, messaging, and autonomous teammates that think for themselves.
Agent Teams
Teammates + Mailboxes
When one agent can't finish, delegate to persistent teammates via async mailboxes
Team Protocols
Shared Communication Rules
One request-response pattern drives all team negotiation
Autonomous Agents
Scan Board, Claim Tasks
Teammates scan the board and claim tasks themselves; no need for the lead to assign each one
Worktree + Task Isolation
Isolate by Directory
Each works in its own directory; tasks manage goals, worktrees manage directories, bound by ID
Parallel Teams
File-Lock Task Board
The key to scaling is decoupling; task board + file locks = linear scalability
L6 Observability & Evaluation
How agents know they got it right. Test-driven development + LLM-as-Judge self-verification loop.
L7 Safety & Governance
Permission tiers and sandbox isolation. Safety should not be the enemy of efficiency.