Dev.to
5/10/2026

Claude Code Source Analysis Series, Chapter 1: Architecture
Short summary
Claude Code is a layered agent runtime with six components wrapping the LLM API: a QueryEngine main loop orchestrates execution; a Tools system provides file I/O, shell access, and MCP; Context/State management assembles what the model should know; Agent Collaboration decomposes complex tasks; Security Governance enforces permissions. The model generates intent; the runtime executes safely. Real power emerges from these engineered systems, not the model alone.
- •Claude Code comprises six architectural layers: Model API, QueryEngine, Tools, Context/State, Agent Collaboration, Security
- •Division of labor: model handles understanding/planning; runtime handles execution/constraints/recording
- •Claude Code's power derives from engineered systems surrounding the model, not from model capability
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



