Skip to main content

Directory Map

The full src/ directory structure with descriptions and links to relevant documentation sections.

Top-Level Structure

src/
├── entrypoints/ → CLI entry points
├── main.tsx → Full CLI initialization
├── Tool.ts → Tool interface definitions
├── Task.ts → Task type definitions
├── QueryEngine.ts → Headless query execution
├── query.ts → Main query loop
├── commands.ts → Command registry
├── bridge/ → Remote-control bridge runtime
├── remote/ → Remote session transports
├── server/ → Direct-connect session plumbing
└── [directories below]

Directory Reference

Core

DirectoryFilesPurposeDocs
entrypoints/8CLI bootstrap, SDK entrypoints, MCP server entrypointStartup & Bootstrap
state/6Zustand-like state storeState & Sessions
context/9React context providersState & Sessions
constants/21Global constants, promptsPrompt, Memory & Context

Tools & Commands

DirectoryFilesPurposeDocs
tools/184Built-in tool implementations and gated tool stubsTool Architecture
commands/207Slash command implementationsCommand System

Services

DirectoryFilesPurposeDocs
services/api/20+API client, auth, providersAPI Client
services/mcp/10+MCP client and configurationMCP Integration
services/tools/10+Tool execution infrastructureTool Execution
services/lsp/5+LSP manager, plugin config, diagnostics pipelineLSP & IDE Integration
services/compact/5+Message compactionPrompt, Memory & Context
services/SessionMemory/5+Session-memory sidecar generationPrompt, Memory & Context
services/extractMemories/3+Durable memory extractionPrompt, Memory & Context
services/settingsSync/3+Cross-environment settings and memory syncPrompt, Memory & Context
services/remoteManagedSettings/5+Enterprise managed settings fetch/pollingStartup & Bootstrap
services/teamMemorySync/5+Repo-scoped shared team memory syncPrompt, Memory & Context
services/analytics/10+GrowthBook, telemetryAnalytics
services/plugins/5+Plugin managementPlugins & Skills
services/policyLimits/3+Enterprise policy enforcementSandbox & Safety

UI

DirectoryFilesPurposeDocs
components/389React terminal UI componentsComponents
screens/5+Full-screen components (REPL)Components
ink/96Custom Ink renderer extensionsComponents
hooks/104React hooksComponents
keybindings/14Keyboard shortcut systemComponents

Extensions

DirectoryFilesPurposeDocs
plugins/2+Plugin system corePlugins & Skills
skills/20Skill system + bundled skillsPlugins & Skills

Agents & Tasks

DirectoryFilesPurposeDocs
tasks/12Task implementations (8 types)Task Management
buddy/6Sub-agent systemSub-Agents & Coordination
coordinator/5+Multi-agent coordinationSub-Agents & Coordination

Infrastructure

DirectoryFilesPurposeDocs
utils/564Utility functionsVarious
utils/permissions/20+Permission logicPermission Model
utils/auth.tsAuthenticationAPI Client
utils/settings/10+Settings loadingStartup & Bootstrap
utils/hooks/5+Lifecycle hook executionPermission Model
utils/claude-md/5+CLAUDE.md loading/mergingPrompt, Memory & Context

Other

DirectoryFilesPurpose
types/11TypeScript type definitions
memdir/8Memory directory management
migrations/11Data migration scripts
bridge/31Remote-control / bridge runtime
cli/19CLI argument parsing and transports
remote/4Remote session transport managers
server/5+Direct-connect session server helpers
vim/5Vim mode support
voice/1Voice input (disabled)
native-ts/3+Native module TypeScript wrappers
outputStyles/3+Terminal output styling

Vendor Directory

vendor/
├── audio-capture-src/ # Native audio recording (macOS/Linux/Windows)
├── image-processor-src/ # Sharp-compatible image processor
├── modifiers-napi-src/ # macOS keyboard modifier detection
└── url-handler-src/ # macOS URL event handler (Apple Events)

Stubs Directory

stubs/
├── @ant/claude-for-chrome-mcp/ # Chrome extension MCP (stub)
├── @anthropic-ai/mcpb/ # MCP bundle processor (stub)
├── @anthropic-ai/sandbox-runtime/ # Sandbox runtime (stub)
├── color-diff-napi/ # Syntax highlighting (stub)
└── modifiers-napi/ # Key modifiers (stub)