Learn Claude Code

Learning Path

s01 to s19: build the agent system progressively across 4 stages

How to Use This Page

First Full Pass

Read top to bottom before jumping around. The first six chapters establish the main loop everything else depends on.

If Things Start to Blur

Do not stare at code first. Identify the stage, then use bridge docs to reset boundaries like task, runtime, teammate, and worktree.

If You Are Rebuilding It

After each stage, stop and rebuild the minimal version yourself instead of waiting until s19 to backfill everything at once.

Bridge Docs Worth Re-reading

When the middle and late chapters start to tangle, revisit these before forcing the next chapter.

The timeline shows both order and where to pause

After each stage, rebuild one working slice before entering the next stage

If you only keep scrolling downward, chapter boundaries will eventually blur. The safer reading move is to pause at `s06 / s11 / s14 / s19` and confirm that you can rebuild the working system slice for that stage.

s01-s06

Pause here and rebuild the single-agent system from scratch

What You Should Be Able To Rebuild Here

A single-agent harness that can survive multiple turns, call tools, keep a todo plan, delegate one-shot subtasks, load skills on demand, and compact context at the minimum useful level.

s07-s11

Stabilize the control plane before moving to the task runtime

What You Should Be Able To Rebuild Here

A single agent with a real control plane: execution gating, extension hooks, durable memory, input assembly, and recovery branches.

s12-s14

Build the work runtime before moving into teams

What You Should Be Able To Rebuild Here

A minimal runtime that can persist task goals, run slow work in the background, return results through notifications, and let time trigger new work.

s15-s19

The final stage: building the platform boundary

What You Should Be Able To Rebuild Here

An agent platform with persistent teammates, shared protocols, autonomous claiming, isolated execution lanes, and one control plane for native and external capabilities.

Stage Legend

Core Loop
System Hardening
Task Runtime
Multi-Agent Platform
Core Loops01-s06

Core Loop: build the smallest useful single-agent system first, including tools, planning, delegation, skills, and context compaction.

After this stage, you should be able to build a working single-agent harness on your own.

Stage Legend
01
s01LoopState + tool_result feedback

The Agent LoopMinimal Closed Loop

130 lines of code1 tools

An agent is just a loop: send messages, execute tools, feed results back, repeat.

Learn More
02
s02Tool specs + dispatch map

Tool UseRoute Intent into Action

169 lines of code4 tools

Adding a tool means adding one handler. The loop never changes.

Learn More
03
s03PlanningState + reminder loop

TodoWriteSession Planning

279 lines of code5 tools

A visible plan keeps the agent on track when tasks get complex.

Learn More
04
s04Delegation with isolated message history

SubagentFresh Context per Subtask

200 lines of code5 tools

A subagent is mainly a context boundary, not a process trick.

Learn More
05
s05Skill registry + on-demand injection

SkillsDiscover Cheaply, Load Deeply

244 lines of code5 tools

Discover cheaply, load deeply -- only when needed.

Learn More
06
s06Persist markers + micro compact + summary compact

Context CompactKeep Active Context Small and Stable

308 lines of code5 tools

Compaction isn't deleting history -- it's relocating detail so the agent can keep working.

Learn More
System Hardenings07-s11

System Hardening: move from 'it runs' to 'it runs safely and predictably' with permissions, hooks, memory, prompt assembly, and error recovery.

After this stage, you should know how to make the agent safer, steadier, and easier to extend.

Stage Legend
07
s07deny / mode / allow / ask pipeline

Permission SystemIntent Must Pass a Safety Gate

308 lines of code4 tools

Safety is a pipeline, not a boolean: deny, check mode, allow, then ask.

Learn More
08
s08Lifecycle events + side-effect hooks

Hook SystemExtend Without Rewriting the Loop

252 lines of code4 tools

The loop owns control flow; hooks only observe, block, or annotate at named moments.

Learn More
09
s09Typed memory records + reload path

Memory SystemKeep Only What Survives Sessions

414 lines of code5 tools

Memory gives direction; current observation gives truth.

Learn More
10
s10Prompt sections + dynamic assembly

System PromptAssemble Inputs as a Pipeline

305 lines of code4 tools

The model sees a constructed input pipeline, not one giant static string.

Learn More
11
s11Continuation reasons + retry branches

Error RecoveryRecover, Then Continue

249 lines of code4 tools

Most failures aren't true task failure -- they're signals to try a different path.

Learn More
Task Runtimes12-s14

Task Runtime: turn work from session-local planning into durable, background, and scheduled execution.

After this stage, you should be able to lift chat-level steps into a durable runtime task system.

Stage Legend
12
s12Task records + dependencies + unlock rules

Task SystemDurable Work Graph

227 lines of code8 tools

Todo lists help a session; durable task graphs coordinate work that outlives it.

Learn More
13
s13RuntimeTaskState + async execution slots

Background TasksBackground Execution Lanes

287 lines of code6 tools

Background execution is a runtime lane, not a second main loop.

Learn More
14
s14Scheduled triggers over runtime tasks

Cron SchedulerLet Time Trigger Work

452 lines of code7 tools

Scheduling is not a separate system -- it just feeds the same agent loop from a timer.

Learn More
Multi-Agent Platforms15-s19

Multi-Agent Platform: add persistent teammates, protocols, autonomy, isolated execution lanes, and MCP / plugin capability routing.

After this stage, you should be able to grow a single agent into a collaborative platform.

Stage Legend
15
s15Team roster + teammate lifecycle

Agent TeamsPersistent Specialist Teammates

350 lines of code10 tools

Teammates persist beyond one prompt, have identity, and coordinate through durable channels.

Learn More
16
s16Protocol envelopes + request correlation

Team ProtocolsShared Request-Response Rules

482 lines of code12 tools

A protocol request is a structured message with an ID; the response must reference the same ID.

Learn More
17
s17Idle polling + role-aware self-claim + resume context

Autonomous AgentsSelf-Claim, Self-Resume

603 lines of code14 tools

Autonomy is a bounded mechanism -- idle, scan, claim, resume -- not magic.

Learn More
18
s18Task-worktree state + explicit enter / closeout lifecycle

Worktree IsolationSeparate Directory, Separate Lane

564 lines of code18 tools

Tasks answer what; worktrees answer where. Keep them separate.

Learn More
19
s19Scoped servers + capability routing

MCP & PluginExternal Capability Bus

463 lines of code4 tools

External capabilities join the same routing, permission, and result-append path as native tools.

Learn More

LOC Growth

s01
130
s02
169
s03
279
s04
200
s05
244
s06
308
s07
308
s08
252
s09
414
s10
305
s11
249
s12
227
s13
287
s14
452
s15
350
s16
482
s17
603
s18
564
s19
463