1.6 KiB
1.6 KiB
Navigating the src/ tree
!!! warning "Read-only study" Use this guide to read the reconstruction. Do not treat the tree as a template for redistributing Anthropic’s product.
Suggested reading order
main argvand lifecycle —src/main.tsx(Commander,preAction, mode routing).- Interactive path —
src/replLauncher.tsx,src/screens/REPL.tsx(queue,onQuery, UI). - Headless path —
src/cli/print.ts,src/cli/structuredIO.ts,src/QueryEngine.ts. - Core loop —
src/query.ts(queryLoop), thensrc/services/api/client.ts/claude.ts. - Tools —
src/tools.ts,src/Tool.ts, then a single tool package e.g.src/tools/BashTool/andsrc/services/tools/. - MCP —
src/services/mcp/andsrc/tools/MCPTool/.
Maps and indexes
- Top-level layout: Appendix: directory structure (and repo
docs/directory-structure.md). - Tool packages: Appendix: tool packages.
- Official doc crosswalk: Official docs map.
Search tips
From the repository root:
# Example: find where a symbol is used
rg "queryLoop" src/query.ts src/ -n
# Example: MCP channel permissions
rg "channelAllowlist" src/services/mcp -n
IDE “go to definition” may be incomplete: there is no root tsconfig.json or package.json mirroring Anthropic’s build, so path aliases like src/... might not resolve everywhere.
Deeper subsystems
Use the Reference section for per-topic entry points (permissions, compaction, telemetry, bridge, etc.).