C Claude Code Internals
EN | ES
Source Code Analysis: ~512,000 lines of TypeScript

Claude Code
Internals

Everything about how Claude Code works, extracted directly from the source code and explained for everyday users.

~1,884 TypeScript files
45 Built-in tools
6 Agent types
200K Context tokens (default)

Explore all sections

01 6 layers

System Prompt

Modular prompt hierarchy and key rules

Read more
02 45 tools

Tools

45 built-in tools by category

Read more
03 6 agents

Agents

6 built-in agent types and capabilities

Read more
04 4 types

Memory

Persistent memory across sessions

Read more
05 6 modes

Permissions

6 modes and the YOLO 2-stage classifier

Read more
06 200K tokens

Context & Compaction

Token budget, auto-compact, output limits

Read more
07 4 models

Costs

Pricing per model and the /fast mode trap

Read more
08 10 retries

Retry Logic

Exponential backoff and error handling

Read more
09 KAIROS

Proactive Mode

KAIROS autonomous mode and tick prompts

Read more
10 10+ flags

Hidden Features

Feature flags and undocumented capabilities

Read more
11 10 tips

Practical Tips

Top 10 tips derived from the source code

Read more
12 17 skills

Skills

17 bundled skills, custom skill format, and discovery system

Read more
13 ~100 cmds

Slash Commands

~100 slash commands across 5 categories

Read more
14 4 transports

MCP

Model Context Protocol: transports, auth, lifecycle, and enterprise policies

Read more
15 2 systems

Bridge & IDE

IDE integration (VS Code, JetBrains) and remote bridge to claude.ai

Read more
16 2 topologies

Coordinator Mode

Multi-agent orchestration: hub-and-spoke coordinator and peer-to-peer team swarms

Read more
17 2 stages

YOLO Classifier

AI security classifier: 2-stage XML protocol, fast paths, fail-closed error handling, and 28 block rule categories

Read more
18 27 events

Hooks

27 events, 4 hook types (command/prompt/agent/HTTP), matching, permission integration, and async patterns

Read more