Interactive Playbook

Understand Claude Code from real code paths

Language
Theme

Top 20 Source Files

The fastest way to enter the codebase

If you only have a few hours, these files give you the highest learning return. They cover bootstrap, UI, query runtime, tools, policy, persistence, and extensibility.

Filter by learning route

#1

src/entrypoints/cli.tsx

Suggested order: 1

True bootstrap edge

Best first file for seeing runtime routing and fast paths.

Layer: Bootstrap

Reading time: 8-10 min

Track fit: Starter picks

  • src/entrypoints/cli.tsx

#2

src/main.tsx

Suggested order: 2

Main runtime entry

Shows how full CLI mode is assembled.

Layer: Bootstrap

Reading time: 15-20 min

Track fit: Starter picks / Runtime picks

  • src/main.tsx

#3

src/entrypoints/init.ts

Suggested order: 3

Initialization hub

Trust-safe env setup, telemetry, network prewarm, and shutdown logic live here.

Layer: Bootstrap

Reading time: 12-15 min

Track fit: Starter picks / Platform picks

  • src/entrypoints/init.ts

#4

src/replLauncher.tsx

Suggested order: 4

Interactive handoff

Bridges runtime setup into the UI app.

Layer: UI

Reading time: 5-8 min

Track fit: Starter picks

  • src/replLauncher.tsx

#5

src/screens/REPL.tsx

Suggested order: 5

Main interactive surface

The center of the live user experience.

Layer: UI

Reading time: 20-30 min

Track fit: Starter picks / Runtime picks

  • src/screens/REPL.tsx

#6

src/commands.ts

Suggested order: 6

Command composition

Explains where slash commands really come from.

Layer: Extensibility

Reading time: 10-12 min

Track fit: Starter picks / Platform picks

  • src/commands.ts

#7

src/tools.ts

Suggested order: 7

Tool registry

Maps the default tool surface and MCP merging.

Layer: Tool runtime

Reading time: 10-12 min

Track fit: Starter picks / Runtime picks

  • src/tools.ts

#8

src/Tool.ts

Suggested order: 8

Core tool contract

Defines the shape of tool execution context.

Layer: Tool runtime

Reading time: 8-10 min

Track fit: Runtime picks

  • src/Tool.ts

#9

src/QueryEngine.ts

Suggested order: 9

Headless engine wrapper

Best bridge between product usage and runtime internals.

Layer: Query runtime

Reading time: 15-18 min

Track fit: Runtime picks

  • src/QueryEngine.ts

#10

src/query.ts

Suggested order: 10

Core query loop

The most important execution file in the whole app.

Layer: Query runtime

Reading time: 25-35 min

Track fit: Runtime picks

  • src/query.ts

#11

src/utils/processUserInput/processUserInput.ts

Suggested order: 11

Input normalization

Shows how prompts, slash commands, and attachments unify.

Layer: Input

Reading time: 10-12 min

Track fit: Runtime picks / Starter picks

  • src/utils/processUserInput/processUserInput.ts

#12

src/services/tools/toolOrchestration.ts

Suggested order: 12

Concurrency-aware scheduling

Key to understanding safe parallel tool execution.

Layer: Tool runtime

Reading time: 12-15 min

Track fit: Runtime picks

  • src/services/tools/toolOrchestration.ts

#13

src/services/tools/StreamingToolExecutor.ts

Suggested order: 13

Streaming tool executor

Shows how order and progress coexist.

Layer: Tool runtime

Reading time: 10-12 min

Track fit: Runtime picks

  • src/services/tools/StreamingToolExecutor.ts

#14

src/services/tools/toolExecution.ts

Suggested order: 14

Execution wrapper

Hooks, telemetry, and result shaping meet here.

Layer: Tool runtime

Reading time: 12-16 min

Track fit: Runtime picks

  • src/services/tools/toolExecution.ts

#15

src/utils/permissions/permissionSetup.ts

Suggested order: 15

Permission context builder

Shows how settings and flags become runtime permission state.

Layer: Policy

Reading time: 15-20 min

Track fit: Platform picks / Runtime picks

  • src/utils/permissions/permissionSetup.ts

#16

src/utils/permissions/permissions.ts

Suggested order: 16

Permission decision engine

Best file for understanding safety behavior.

Layer: Policy

Reading time: 20-25 min

Track fit: Platform picks / Runtime picks

  • src/utils/permissions/permissions.ts

#17

src/utils/auth.ts

Suggested order: 17

Multi-mode auth layer

Shows how many auth paths Claude Code actually supports.

Layer: Auth

Reading time: 20-25 min

Track fit: Platform picks

  • src/utils/auth.ts

#18

src/utils/config.ts

Suggested order: 18

Config persistence core

Global and project config meet here.

Layer: Config

Reading time: 18-22 min

Track fit: Platform picks

  • src/utils/config.ts

#19

src/utils/sessionStorage.ts

Suggested order: 19

Durable transcript storage

Excellent case study in transcript durability.

Layer: Persistence

Reading time: 18-24 min

Track fit: Runtime picks / Platform picks

  • src/utils/sessionStorage.ts

#20

src/services/mcp/client.ts

Suggested order: 20

MCP client implementation

One of the most important files for extensibility and interoperability.

Layer: MCP

Reading time: 30-40 min

Track fit: Platform picks

  • src/services/mcp/client.ts