05. Recommended Reading Order
Fast Path: Learn the System Without Drowning
source/main.tsxLearn the boot path, startup sequencing, feature gates, and main loop setup.source/commands.tsLearn how the product exposes modes and slash commands.source/Tool.tsLearn the shape of tool contracts and the execution context.source/tools.tsLearn the full capability surface.source/tools/BashTool/*Learn the most important safety architecture in the tree.source/services/api/client.tsandsource/services/api/claude.tsLearn provider setup and model request wiring.source/services/mcp/auth.tsandsource/services/mcp/client.tsLearn how external tool ecosystems get integrated.source/components/*andsource/ink/*Learn how the product feel is implemented.
If Your Goal Is Different
| Goal | Read First |
|---|---|
| Build your own terminal AI shell | main.tsx, commands.ts, components/, ink/ |
| Learn safe tool execution | Tool.ts, tools.ts, tools/BashTool/*, utils/permissions/ |
| Build provider adapters | services/api/client.ts, services/api/claude.ts, utils/model/ |
| Learn MCP integration | services/mcp/*, tools/MCPTool/*, tools/ListMcpResourcesTool/* |
What To Ignore At First
- Most feature-flagged long-tail commands.
- Internal-only branches conditioned on
USER_TYPE === 'ant'. - Low-level UI rendering support files unless you are studying Ink deeply.
- Analytics details unless you are studying product telemetry.
Final Rule
Read for architecture, not for total coverage. The value of this tree is learning how a model-driven CLI product
is decomposed into boot flow, commands, tools, permissions, adapters, UI, and state.
Source Navigation
Recommended Source Files
source/main.tsxsource/tools.tssource/tools/BashTool/BashTool.tsxsource/services/api/client.tssource/services/mcp/auth.ts
Next Files to Read
source/services/api/claude.tssource/tools/AgentTool/AgentTool.tsxsource/services/compact/compact.ts