中文 | English
- Readers who can already navigate the core files and now want architectural boundaries
- Readers who want a system-level understanding of permissions, memory, runtime modes, coordinator, and extension topics
2-3 hours
Only after the mainline is stable should this stage open the boundary topics. You only need to clarify four surrounding layers now:
- how permissions protect the mainline before and after tool execution
- how memory and context support the mainline over longer horizons
- how runtime modes branch beyond the REPL into print, serve, and bridge
- how coordinator, structured output, and extension surfaces attach around the mainline
Mainline position: mainline is stable → branch outward into permissions, memory, runtime modes, coordinator, and related boundaries
P4 does not reteach the single-turn loop. It assumes you can already explain the request lifecycle from P1-P3.
Only after the mainline is secure does it make sense to study these outer boundaries:
- which mechanisms sit directly around the mainline, like permissions
- which mechanisms maintain longer-lived capability outside the turn, like memory
- which mechanisms branch the system into different runtime surfaces, like print, serve, and bridge
- which mechanisms coordinate higher-level behavior, like coordinator and structured output
Start with the example closest to the mainline boundary:
python examples/l7_permissions.pyOnce that feels stable, add topic branches as needed:
python examples/l6_advanced.py
python examples/l1_startup.py serve
python examples/l1_startup.py --print "hello"The rule here is not “run every example.” It is “revisit the mainline through the boundary you are studying.”
Start with the boundary closest to the mainline, then move outward:
- L7 Permissions
- L14 Memory Extraction And Team Memory
- L15 Print, Serve, Bridge, And Other Runtime Modes
- L6 Advanced Mechanisms
- L13 MCP, Hooks, And Plugins
- Design Philosophy
Open files by boundary theme:
- permissions:
claudecode_src/src/tools/BashTool/bashPermissions.ts,claudecode_src/src/tools/BashTool/bashSecurity.ts - memory:
claudecode_src/src/services/extractMemories/extractMemories.ts,claudecode_src/src/memdir/memdir.ts - runtime / coordinator:
claudecode_src/src/coordinator/coordinatorMode.ts,claudecode_src/src/bridge/bridgeMain.ts,claudecode_src/src/tools/SyntheticOutputTool/SyntheticOutputTool.ts - extensions:
claudecode_src/src/utils/hooks/execAgentHook.ts,claudecode_src/src/plugins/builtinPlugins.ts
To keep this boundary reading controlled, do not do these things:
- do not jump into P4 if the mainline is not stable yet
- do not trace every plugin, hook, or MCP detail in one pass
- do not execute every memory extraction path end-to-end
- do not read all multi-agent code at once; lock in the coordinator / structured-output boundary first
- if
query.ts,QueryEngine.ts, andservices/api/claude.tsare still blurry, go back to P3 first
P4 is meant to create boundary sense outside the mainline, not a new flood of information.
Read in this order:
L13L6- search
execAgentHook,builtinPlugins, andENTRYPOINT_NAME
Read in this order:
L14- search
buildMemoryLinesandextractMemories - then return to how
QueryEngineconsumes context results
Read in this order:
L15L6- search
bridgeMainandSYNTHETIC_OUTPUT_TOOL_NAME
SYNTHETIC_OUTPUT_TOOL_NAMEexecAgentHookbuiltinPluginsENTRYPOINT_NAMEbuildMemoryLinesextractMemoriesbridgeMain
- Why does Claude Code keep multiple extension surfaces instead of one universal plugin system?
- What is the real boundary between memory extraction and context management?
- Why does Claude Code need print, serve, and bridge in addition to the REPL?
Write your own architecture summary and cover at least three of these four ideas:
extension surfacesmemory indexruntime modesstructured output boundary
Rules:
- do not only list features
- every conclusion should trace back to concrete source symbols
By the end of this page, you should be able to:
- explain Claude Code’s major architectural boundaries in your own words
- point to the files that carry permissions, memory, runtime modes, and extension surfaces
- explain why “many features” and “clear architecture” are not the same thing
- know clearly that all of this depends on the P1-P3 mainline already being stable
If you cannot, go back to:
P3if the three mainline files are still unstableL6if multi-agent and structured-output boundaries are still fuzzyL14if memory still feels like “put more text into the prompt”L15if Claude Code still feels like only a REPL tool
At this point, go back to:
You should now be able to choose the next source area to study on your own.