There is a full unofficial 46-page paper that talks about its architecture in comprehensive detail. Based on a source-based analysis of publicly available Claude Code TypeScript code, using that code to reconstruct the system design.
Summary of Key Ideas
The paper’s main claim is that Claude Code itself is architecturally simple at the center: a basic loop that calls the model, runs tools, and repeats. The real sophistication sits in the surrounding harness.
That harness is what the paper focuses on: permissions, context management, extensibility, subagent orchestration, and durable session persistence.
The authors frame Claude Code as a system optimized around five values: human control, safety/security, reliable execution, capability amplification, and context adaptability.
Claude Code uses a layered safety model rather than trusting user approvals alone: deny-first rules, multiple permission modes, an ML-based auto-mode classifier, hook interception, and optional shell sandboxing.
Context management is treated as a first-class bottleneck. The paper argues Claude Code uses a multi-step compaction pipeline plus lazy loading of instructions and tools so the context window stays usable over long sessions.
Extensibility is split into four distinct mechanisms, each with a different role: MCP for tool integration, plugins for packaging, skills for lightweight instruction shaping, and hooks for lifecycle interception.
Subagents are presented as isolated workers rather than just extra prompts in the same thread. They can run with separate configs, tools, and even separate worktrees.
Persistence is append-oriented: transcripts are stored as JSONL, can be resumed or forked, and are designed to outlive the active context window.

My takes on what stands out most:
The strongest surprise is how much of the product is “scaffolding,” not model logic. The paper keeps coming back to the idea that the core loop is simple and most of the engineering effort is in the control system around it.
The permission system is more layered than most people would guess. The paper identifies seven safety layers, not just “ask user before running command.”
User approval prompts are considered behaviorally unreliable because users approve about 93% of them. So the design response was not “ask better,” but “rely less on prompts and more on boundaries.”
Context management is not one summary step, but a five-stage compaction pipeline plus lazy-loading of instructions, rules, and tool definitions.
CLAUDE.md is apparently not just a static instruction file. The paper describes a hierarchy of memory files, path-scoped lazy loading, and even the detail that this content is injected as user-context rather than system-prompt content. A fully modular pipeline to create CLAUDE.md.
A particularly interesting design choice: resumed or forked sessions do not restore previously granted session permissions. The system treats each session as a fresh trust boundary, even at the cost of friction.
The persistence model is unusually transparent. Instead of opaque state, the paper says Claude Code uses append-only JSONL transcripts and sidechain transcript files for subagents.
The paper points to one sharp edge: under adversarial/performance pressure, some safety guarantees can weaken together because multiple layers share latency and cost constraints. It cites a case where commands with more than 50 subcommands may collapse into a single generic approval path.
Anthropic never wrote a detailed architecture document - all we know, about the model and its harness, is from their piece-wise communications. So, this unofficial structured writeup fills in a crucial gap. Read the full paper here.


The 93% user-approval finding is the part that lands hardest for me. It's essentially an eval result that says the prompt layer has almost no discriminative power, which is why the permission system had to move to deny-first rules and a classifier. The same pattern shows up in LLM evals: if a human judge accepts 93% of candidate outputs, the judge is not the constraint, the prompt is. What I'd love to see next is an adversarial trajectory suite that stress-tests the seven layers together, since the paper already flags that under latency pressure multiple guarantees can degrade at once. That coupling is the interesting failure mode, not the individual layer coverage.