05. Recommended Reading Order

Fast Path: Learn the System Without Drowning

  1. source/main.tsx Learn the boot path, startup sequencing, feature gates, and main loop setup.
  2. source/commands.ts Learn how the product exposes modes and slash commands.
  3. source/Tool.ts Learn the shape of tool contracts and the execution context.
  4. source/tools.ts Learn the full capability surface.
  5. source/tools/BashTool/* Learn the most important safety architecture in the tree.
  6. source/services/api/client.ts and source/services/api/claude.ts Learn provider setup and model request wiring.
  7. source/services/mcp/auth.ts and source/services/mcp/client.ts Learn how external tool ecosystems get integrated.
  8. source/components/* and source/ink/* Learn how the product feel is implemented.

If Your Goal Is Different

GoalRead First
Build your own terminal AI shellmain.tsx, commands.ts, components/, ink/
Learn safe tool executionTool.ts, tools.ts, tools/BashTool/*, utils/permissions/
Build provider adaptersservices/api/client.ts, services/api/claude.ts, utils/model/
Learn MCP integrationservices/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.tsx
  • source/tools.ts
  • source/tools/BashTool/BashTool.tsx
  • source/services/api/client.ts
  • source/services/mcp/auth.ts

Next Files to Read

  • source/services/api/claude.ts
  • source/tools/AgentTool/AgentTool.tsx
  • source/services/compact/compact.ts