Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…

Listen to today's AI briefing

Daily podcast — 5 min, AI-narrated summary of top stories

A diagram of Claude Code's six-layer architecture with labeled layers and connecting arrows, illustrating a…
AI ResearchScore: 85

Claude Code's Six-Layer Architecture: Harness, Not Magic

Claude Code's six-layer architecture uses a 3-layer context compressor at 92% threshold and Redis-based multi-agent FSM protocol. The model is just one node in a harness.

·4h ago·3 min read··5 views·AI-Generated·Report error
Share:
What is the architecture of Claude Code?

Claude Code's architecture comprises six layers: Input, Knowledge, Execution, Integration, Multi-Agent, and Observability. The Knowledge layer uses a 3-layer context compressor at 92% threshold, and the Multi-Agent layer employs Redis pub/sub for subagent communication and an FSM protocol.

TL;DR

Claude Code has six layers, not just a CLI. · Knowledge layer uses 3-layer compressor at 92% threshold. · Multi-agent layer uses Redis pub/sub and FSM protocol.

Anthropic's Claude Code operates across six distinct layers, not as a simple CLI. The architecture, detailed by developer @akshay_pachaar, reveals a harness system where the model is just one node in a perception-action-observation loop.

Key facts

  • Six layers: Input, Knowledge, Execution, Integration, Multi-Agent, Observability.
  • Knowledge layer uses 3-layer context compressor at 92% threshold.
  • Multi-Agent layer uses Redis pub/sub for subagent communication.
  • Execution layer uses typed registry with one handler per tool.
  • Master loop: perception → action → observation.

The Six Layers

Claude Code's architecture, as mapped by @akshay_pachaar, comprises six layers that transform a language model into a production-grade agent. The Input Layer handles session management, permission gating, and YAML-based trust tiers before any request reaches the model. The Knowledge Layer holds the skill registry, a 3-layer context compressor operating at a 92% threshold, task graph, and cross-session memory store—this is where harness intelligence lives outside the weights.

The Execution Layer runs tool dispatch through a typed registry with one handler per tool: bash, read, write, grep, glob, revert. A streaming runtime handles parallel execution, and prompt cache reuses stable prefixes at 10% cost. The Integration Layer connects the MCP runtime to external servers (filesystem, git, custom), with tools registering inward and memory writes outward to agent_memory.md.

The Multi-Agent Layer is the most underappreciated piece. It includes a subagent spawner, teammate mailboxes over Redis pub/sub, an FSM protocol (IDLE→REQUEST→WAIT→RESPOND), an autonomous board with atomic locks, and worktree isolation with per-task branches and conflict detection on merge. The Observability Layer wraps everything with an event bus featuring lifecycle hooks and a background executor running daemon threads non-blocking.

The Master Loop

At the center sits the master agent loop: perception → action → observation. It is deliberately simple—a "dumb loop" where the model reasons and the harness mediates. This design pattern, shared across Anthropic, OpenAI, LangChain, and others, prioritizes reliability over complexity.

Why This Matters

The unique take: Claude Code's architecture reveals that the real innovation in AI agents is not the model but the harness engineering. The Knowledge layer's context compressor at 92% threshold and the Multi-Agent layer's Redis-based FSM protocol represent infrastructure decisions that determine whether an agent succeeds or fails in production. This is the architecture behind what feels like magic—it is not magic, it is harness engineering.

What to watch

Watch for Anthropic's upcoming technical report on Claude Code's benchmark performance—specifically SWE-Bench and SWE-Bench Verified scores—and whether the multi-agent layer's FSM protocol scales beyond the current subagent limit.

Source: gentic.news · · author= · citation.json

AI-assisted reporting. Generated by gentic.news from multiple verified sources, fact-checked against the Living Graph of 4,300+ entities. Edited by Ala SMITH.

Following this story?

Get a weekly digest with AI predictions, trends, and analysis — free.

AI Analysis

The architecture described by @akshay_pachaar positions Claude Code as a reference implementation for agent harness design. The Knowledge layer's context compressor at 92% threshold is notable—most agents either truncate or use a single-pass compressor, but a 3-layer approach suggests Anthropic has invested significantly in preserving context across long sessions. The Multi-Agent layer's Redis pub/sub and FSM protocol mirror patterns seen in distributed systems, not AI research, indicating that production agent reliability may depend more on systems engineering than model capability. Compared to OpenAI's Codex CLI and LangChain's agent frameworks, Claude Code's approach is more opinionated—it enforces a strict separation of concerns across six layers rather than allowing ad-hoc tool composition. This trade-off sacrifices flexibility for reliability, which may explain why Claude Code feels more polished in practice. The 'dumb loop' design is a deliberate rejection of the trend toward increasingly complex agent architectures; Anthropic bets that a simple loop with a strong harness beats a complex loop with a weak harness. The omission of any discussion of safety layers (beyond input permission gating) is conspicuous. Given Anthropic's focus on alignment, one would expect a dedicated safety layer with sandboxing and monitoring. Either this is omitted from the diagram, or it is embedded within the Observability layer's lifecycle hooks—a design choice worth investigating.

Mentioned in this article

Enjoyed this article?
Share:

AI Toolslive

Five one-click lenses on this article. Cached for 24h.

Pick a tool above to generate an instant lens on this article.

Related Articles

From the lab

The framework underneath this story

Every article on this site sits on top of one engine and one framework — both built by the lab.

More in AI Research

View all