This repository has been archived on 2026-04-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
claude-code-2026-04-02/docs-site/docs/developer/navigating-the-source.md
2026-03-31 16:04:03 +05:00

1.6 KiB
Raw Blame History

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 Anthropics product.

Suggested reading order

  1. main argv and lifecyclesrc/main.tsx (Commander, preAction, mode routing).
  2. Interactive pathsrc/replLauncher.tsx, src/screens/REPL.tsx (queue, onQuery, UI).
  3. Headless pathsrc/cli/print.ts, src/cli/structuredIO.ts, src/QueryEngine.ts.
  4. Core loopsrc/query.ts (queryLoop), then src/services/api/client.ts / claude.ts.
  5. Toolssrc/tools.ts, src/Tool.ts, then a single tool package e.g. src/tools/BashTool/ and src/services/tools/.
  6. MCPsrc/services/mcp/ and src/tools/MCPTool/.

Maps and indexes

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 Anthropics 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.).