Inside Claude Code: a five-layer agent architecture and a prompt cache that cuts cost to ~10%
goyalshaliniuk · x · 2026-11-25
A long thread breaks down the agent architecture behind Claude Code's apparent magic, in five layers:
- Input layer: CLI/IDE/CI interfaces, a session manager (resume, fork, persist), and a permission gate — nothing runs without approval.
- Knowledge layer: skill registry, task graph, context compressor, and a cross-session memory store — how it "remembers."
- Master agent loop: Perception → Action → Observation, the system's heartbeat.
- Execution layer: typed tool dispatch, streaming parallel runtime, and a prompt cache that cuts cost to 10%.
- Observability layer: event bus plus background executor, with lifecycle hooks and interception baked in.
More from coding & agent
- Cloudflare lets AI agents activate paid subscriptions via MCP and CLI — irvinebroque · 2026-11-26
- Anthropic engineer on the Rust rewrite of the Claude API, shadow-traffic verification, and dropping coding interviews — gigasquid · 2026-11-26
- Cognition launches Org Charts: one canvas to oversee all your Devin agents — marvinvonhagen · 2026-11-26
- Pydantic open-sources its sandbox benchmark, admits Daytona was mis-measured — samuelcolvin · 2026-11-26
- AI needs its power loom: why better models alone won't deliver industrial productivity — petitbonheurfr · 2026-11-26
- Theory Ventures' AI agent hackathon: run a bakery with agents for 5 hours — sh_reya · 2026-11-26