0%

On March 31, 2026, Anthropic’s Claude Code source code was accidentally leaked. As one of the most widely used AI coding assistants, the leak gave the community its first real look at how this kind of product is built. After reading through it, the architecture differs significantly from what most people assume. Most developers assumed it was just a thin CLI wrapper around API calls. The actual codebase and engineering depth say otherwise.

Read more »

Claude Code doesn’t use the ReAct pattern to drive its agent loop. In 2025’s agent landscape, this is a surprising choice. ReAct had become the default for frameworks like LangChain and AutoGPT. But Claude Code went with an Async Generator state machine instead, replacing the traditional think-act-observe loop with a while (true) + state = next + continue structure. This design decision solved fundamental limitations that ReAct has with streaming interaction and fault recovery.

Read more »

Open Telegram on your phone, send Claude Code a message, and it starts working on your computer. The Channel system breaks the terminal-only constraint on AI coding assistants. Any IM platform can now control your agent remotely. Security comes from six layers of access control plus a permission relay system, and the MCP protocol handles multi-platform support.

Read more »

Claude Code’s Computer Use feature lets AI directly operate the desktop environment: clicking buttons, typing text, taking screenshots to analyze interface state. Giving AI screen access plus mouse and keyboard control introduces real risks: accidental file deletion, misclicks, sensitive data leaks. To address this, Claude Code implements a nine-layer security gate system where each layer can independently intercept dangerous operations. Under the hood, a Python Bridge handles the cross-language work — a TypeScript proxy drives a Python executor that performs the actual desktop interactions.

Read more »

Context Windows Are a Real Hard Constraint

Every LLM has context limits. Claude 3.5 Sonnet advertises 200k tokens, but the system prompt takes about 20k, tool definitions take about 15k — fixed overhead consumes roughly 35k before anything else. That leaves around 165k tokens for conversation. At an average of 4k tokens per turn, 50 turns will exhaust the window.

Traditional truncation bluntly drops early messages. The problems are obvious: important info vanishes, the model re-asks answered questions, or contradicts earlier context. In long conversations, this information loss directly causes task failure.

Claude Code addresses this with a four-level progressive compression strategy. The four levels trigger from lightest to heaviest. The goal: preserve as much task-useful info as possible within a tight token budget.

Read more »

The Starting Problem

Every conversation with a coding assistant starts from scratch. Users repeat the same context over and over: their role, coding preferences, recent project decisions. This information can’t be inferred from the repository, but without it, the AI can’t provide truly coherent assistance.

Claude Code’s Memory system solves this with a persistent, structured knowledge base. It’s not a chat log archive. It’s a knowledge management system with explicit types, automatic extraction, and intelligent retrieval.

Read more »

The Single-Agent Bottleneck

Consider a typical scenario: migrate all TypeScript files in a project to strict mode, update ESLint config, then run tests to confirm no regressions. A single agent can only execute sequentially — modify tsconfig, modify ESLint, modify files, run tests, each step waiting for the previous one to finish. For a project with 200 files, this could take over ten minutes.

Multi-agent orchestration breaks this kind of task into parallelizable subtasks. An Explore Agent scans files to identify modification points, multiple Fork Agents modify different file groups in parallel, a Plan Agent coordinates order to avoid conflicts, and a Verification Agent runs tests to validate results. Parallelization, specialization, isolation — that’s what multi-agent orchestration is for.

Read more »

The Core Contradiction of Agent Execution Permissions

AI agents need to execute commands, modify files, and access networks to complete programming tasks, but these operations all carry destructive risk. The permission system has to balance agent efficiency against safety. Too permissive and you risk irreversible damage. Too restrictive and the agent gets stuck waiting for human approval on everything.

Claude Code’s permission system solves this with a five-layer decision mechanism. Each layer can independently interrupt tool calls, progressing from deterministic rule matching to probabilistic AI classifiers, with the user as the final backstop.

Read more »

The 20k Token Cache Challenge

Claude Code’s system prompt is roughly 20k tokens, sent with every API call. That alone isn’t daunting, but layer on two constraints and it becomes an engineering problem. First, dynamism: the system prompt needs to include current date, project structure, Git status, MCP server instructions, CLAUDE.md user directives — content that can change every turn. Second, cost: without cache optimization, a 20k token prompt means multiplied latency and API fees per session.

The solution is splitting the system prompt into static cacheable regions and dynamic mutable regions, separated by cache boundary markers. Static parts (role definition, system rules, task guidance, tool descriptions, style constraints) get cached globally. Dynamic portions (session guidance, memory system, environment info, MCP instructions, token budget) cache at session level. Each API call reuses the static portion from cache — only the dynamic part needs recalculation.

Read more »

More Than Command Aliases

Skills appear on the surface as slash commands (/code-review, /commit), but they’re fundamentally a complete AI behavior definition system. A single Skill file can constrain the tool pool, pin the model, inject Hooks, and pick an execution context (inline or fork) — all at once. Combined, these capabilities turn Skills into reusable behavior templates, not simple prompt shortcuts.

Read more »