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

38 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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 lifecycle** — `src/main.tsx` (Commander, `preAction`, mode routing).
2. **Interactive path**`src/replLauncher.tsx`, `src/screens/REPL.tsx` (queue, `onQuery`, UI).
3. **Headless path**`src/cli/print.ts`, `src/cli/structuredIO.ts`, `src/QueryEngine.ts`.
4. **Core loop**`src/query.ts` (`queryLoop`), then `src/services/api/client.ts` / `claude.ts`.
5. **Tools**`src/tools.ts`, `src/Tool.ts`, then a single tool package e.g. `src/tools/BashTool/` and `src/services/tools/`.
6. **MCP**`src/services/mcp/` and `src/tools/MCPTool/`.
## Maps and indexes
- Top-level layout: [Appendix: directory structure](../appendix/directory-structure.md) (and repo `docs/directory-structure.md`).
- Tool packages: [Appendix: tool packages](../appendix/tool-packages.md).
- Official doc crosswalk: [Official docs map](../official-docs-map.md).
## Search tips
From the repository root:
```bash
# 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](../reference/cli-entry.md) section for per-topic entry points (permissions, compaction, telemetry, bridge, etc.).