Architecture of anthropics/claude-code
anthropics/claude-code is 1,124 source files holding 1,289 symbols across 5 modules, written mainly in TypeScript, Python, Shell. The largest module is mods, with 902 files, and 5 files are entry points into the dependency graph.
How claude-code fits together
Of the 1124 files in the repository, 902 sit under mods, which groups subsystems by concern. mods/diff/hooks provides orchestration helpers for two related interaction modes, and mods/sec-default/hooks turns security policy decisions into a memoized record. The plugins directory holds 35 files, including plugins/hookify/core, which loads plugin and config state and evaluates rules. The scripts directory contains five TypeScript entry points, such as scripts/sweep.ts and scripts/issue-lifecycle.ts, which implement three related workflows. The .claude/commands directory defines commands such as triage-issue.md and commit-push-pr.md. The .devcontainer/Dockerfile file defines the development container.
Largest modules
- mods: 902 files and 16,376 lines of code
- plugins: 35 files and 6,403 lines of code
- examples: 13 files and 2,365 lines of code
- scripts: 8 files and 791 lines of code
- .devcontainer: 2 files and 170 lines of code
Languages
By file count: TypeScript 907 files, Python 21 files, Shell 21 files, Terraform 8 files, Dockerfile 3 files.
Documentation
Repowise documents claude-code in 700 pages generated from the source, 60 of them written explanations of the repository and its modules. Module guides include:
- mods/agents-md/hooks/modes: Agent Mode Selection
- mods/agents-md/hooks/telemetry: Agents Telemetry Capture
- mods/diff/hooks: Ask and Armed Hooks
- mods/diff/hooks/backend: Backend Diff Retrieval
More on claude-code: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos