How Claude Code Assembles Its System Prompt
Drew Breunig reverse-engineered the leaked Claude Code source to map out how Anthropic's coding agent builds its system prompt - not as a static blob, but as a conditional assembly of 38-plus sections toggled by user type, config flags, and session state. Internal Anthropic employees get different verbosity settings than external users. MCP server instructions get recomputed every turn. The prompt itself is only one layer; tool definitions, CLAUDE.md files, conversation compaction, and skill injection all feed into what the model actually sees. With several teardowns of agent internals appearing in the past few weeks, context engineering is quickly becoming the main surface area people study when comparing coding tools.