Claude Code Internals
A documentation only view into the inner workings of Claude Code
Ask AI about Claude Code Internals
Powered by Claude Β· Grounded in docs
I know everything about Claude Code Internals. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Claude Code β Source Code Documentation
Note: This repository does not contain Claude Code's source code. It is a documentation project β file-by-file and directory-level write-ups that explain the architecture, purpose, and behaviour of Claude Code, Anthropic's interactive AI-powered command-line interface. Each directory in the documented codebase has its own
README.md, and individual source files have corresponding documentation entries. This repo exists purely for educational and reference purposes.
Claude Code itself is a TypeScript codebase (~1,300+ files) that powers the claude CLI tool β an AI assistant that can read files, write code, run commands, search codebases, and much more, all from your terminal.
Table of Contents
- What is Claude Code?
- Architecture Overview
- Technology Stack
- How a Conversation Works
- Project Structure
- Key Concepts
- Getting Started Reading the Code
- Directory Index
What is Claude Code?
Claude Code is a terminal-based AI assistant that:
- Reads and understands code β It can read any file, search with grep/glob, and understand project structure
- Writes and edits code β It can create files, make surgical edits, and refactor across a codebase
- Runs commands β It executes shell commands (with user permission) to build, test, and deploy
- Uses external tools β It connects to MCP servers, LSP servers, and other development tools
- Manages sub-agents β It can spawn background agents for parallel work
- Remembers context β It has a persistent memory system and conversation history
The user interacts via a terminal REPL (read-eval-print loop). They type natural language, Claude responds with text and tool calls, and the cycle repeats.
Platform Support
- CLI: Terminal on macOS, Linux, Windows
- Desktop App: Mac, Windows
- Web App: claude.ai/code
- IDE Extensions: VS Code, JetBrains
Architecture Overview
Claude Code is built with React + Ink (a React renderer for terminal UIs) and communicates with the Claude API for AI responses. Here's the high-level architecture:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Terminal UI β
β βββββββββββββββ ββββββββββββββββ βββββββββββββββββββββ β
β β PromptInput β β Messages β β Permissions β β
β β (user types)β β (responses) β β (approve/deny) β β
β ββββββββ¬βββββββ ββββββββ²ββββββββ ββββββββββ²βββββββββββ β
β β β β β
β ββββββββΌβββββββββββββββββ΄βββββββββββββββββββββ΄βββββββββββ β
β β React + Ink β β
β β (Terminal UI Framework) β β
β ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ€
β Core Engine β
β ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββ β
β β QueryEngine β β
β β (Conversation loop orchestrator) β β
β βββββββββ¬βββββββββββββββ¬βββββββββββββββββββ¬ββββββββββββββ β
β β β β β
β βββββββββΌβββββββ ββββββΌββββββββββ ββββββββΌβββββββββββ β
β β Claude API β β Tool System β β Hook System β β
β β (streaming) β β (42+ tools) β β (20+ events) β β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ β
β β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ β
β β MCP Client β β Permissions β β State Store β β
β β (external β β (rule-based β β (Zustand-like) β β
β β tools) β β security) β β β β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Entry Points
Entry Points
βββ cli.tsx β Fast-path version check, feature gates
βββ main.tsx β Bootstrap, lazy loading, CLI dispatch (~19K LOC)
βββ setup.ts β Pre-session config (Node check, worktree, watchers)
βββ replLauncher.tsx β Launch REPL or headless mode
Core Loop (QueryEngine.ts)
Core Loop
βββ Process user input (slash commands, attachments)
βββ Build context (system prompt, git status, memory)
βββ Load tools dynamically (MCP, plugins, skills)
βββ Stream API call to Claude
βββ Execute tools via StreamingToolExecutor
βββ Auto-compact history if needed
βββ Render results to UI
Technology Stack
| Layer | Technology | Purpose |
|---|---|---|
| Language | TypeScript | ~1,300+ files, 33MB source |
| Runtime | Bun | Fast startup, native APIs, build-time dead code elimination via feature() gates |
| UI Framework | React + Custom Ink | Terminal UI rendering with React component model |
| Layout Engine | Yoga | Flexbox-style layout for terminal |
| State | Zustand-style store | Global application state (450+ fields) |
| Validation | Zod | Runtime type validation for tool inputs, schemas, settings |
| API Client | @anthropic-ai/sdk | Claude API communication with streaming |
| MCP Client | @modelcontextprotocol/sdk | Connect to external tool servers |
| CLI Parsing | Commander.js | Command-line argument parsing |
How a Conversation Works
Understanding this flow is key to understanding the entire codebase:
1. USER TYPES A MESSAGE
βββΆ PromptInput component captures input
βββΆ processUserInput() routes it (text, /command, or !shell)
2. MESSAGE SENT TO CLAUDE API
βββΆ QueryEngine.submit() sends conversation history + system prompt
βββΆ services/api/claude.ts handles streaming, retries, caching
βββΆ Response streams back token-by-token
3. CLAUDE RESPONDS (text and/or tool calls)
βββΆ Text is rendered immediately in the terminal
βββΆ Tool calls enter the tool execution pipeline:
4. TOOL EXECUTION
βββΆ Tool.checkPermissions() evaluates permission rules
βββΆ "allow" β execute immediately
βββΆ "deny" β reject with explanation
βββΆ "ask" β render PermissionRequest component
βββΆ User approves/denies in the terminal
βββΆ Tool.call() executes the action (read file, run command, etc.)
βββΆ Result sent back to Claude as a tool_result message
5. LOOP CONTINUES
βββΆ Claude sees tool results, may call more tools or respond with text
βββΆ Loop repeats until Claude has no more tool calls
6. POST-PROCESSING
βββΆ Hooks fire (PostToolUse, Stop, etc.)
βββΆ Memory extraction runs in background
βββΆ Session is saved to disk
Project Structure
All source code lives in src/. There are no other top-level source directories.
Claude Code Source/
βββ README.md β You are here (project entry point)
βββ CLAUDE.md β Instructions for Claude itself
βββ src/ β All source code
βββ main.tsx β Main bootstrap (~19K LOC)
βββ QueryEngine.ts β Core conversation loop
βββ Tool.ts β Tool interface definition
βββ tools.ts β Tool registry
βββ commands.ts β Command registry
βββ query.ts β Query logic
βββ tasks.ts β Task system types
β
βββ entrypoints/ β Application entry points (CLI, SDK, MCP)
βββ bootstrap/ β Startup initialization
βββ state/ β Global state store
βββ context/ β React contexts
β
βββ tools/ β 42+ tool implementations
βββ commands/ β 90+ slash commands
βββ skills/ β Bundled skills (/commit, /review)
βββ plugins/ β Plugin system
β
βββ components/ β 146+ terminal UI components
βββ ink/ β Custom terminal renderer
βββ screens/ β Top-level screen components
β
βββ services/ β 20 core services (API, MCP, analytics...)
βββ hooks/ β 76+ React hooks
βββ utils/ β 331+ utility modules
β
βββ cli/ β CLI infrastructure & transports
βββ bridge/ β Remote bridge mode
βββ coordinator/ β Multi-agent coordination
βββ server/ β Direct Connect server mode
βββ tasks/ β Background task types
β
βββ vim/ β Vim mode implementation
βββ voice/ β Voice input support
βββ keybindings/ β Keybinding system
βββ constants/ β Application constants
βββ types/ β TypeScript type definitions
βββ schemas/ β Zod validation schemas
βββ migrations/ β Data migrations
βββ native-ts/ β Native TS ports (layout, search, diff)
βββ memdir/ β Persistent memory system
βββ buddy/ β Companion pet system
βββ ... β Additional modules
Start here: src/README.md β detailed overview of every directory and file with navigation links.
Key Concepts
1. Tools
Tools are capabilities that Claude can invoke during a conversation. Each tool is defined with buildTool() and has:
- Input schema (Zod) β validated parameters
- Permission model β what requires user approval
- Execution logic β the actual implementation
42+ built-in tools including:
- File I/O:
Read,Write,Edit,Glob,Grep - Execution:
Bash,PowerShell,REPL - Web:
WebSearch,WebFetch - Code Intelligence:
LSP(goToDefinition, findReferences, hover) - Orchestration:
Agent,Skill,TodoWrite,Task* - MCP:
MCPTool,ListMcpResources,ReadMcpResource - Planning:
EnterPlanMode,ExitPlanMode - Worktree:
EnterWorktree,ExitWorktree - Interaction:
AskUserQuestion,SendMessage - Scheduling:
CronCreate,CronDelete,CronList
Deep dive: src/tools/README.md
2. The Permission System
Every potentially dangerous action goes through a permission check:
- alwaysAllow β auto-approve (e.g., reading files in the project)
- alwaysDeny β auto-reject (e.g., blocked commands)
- alwaysAsk β prompt the user every time
Permissions support pattern matching: "Bash(npm test)" allows only npm test, "Bash(git:*)" allows all git commands, "FileWrite(src/**)" allows writing to src/.
Permission modes: default (ask), plan (pause before execution), bypassPermissions, auto.
Deep dive: src/utils/permissions/README.md
3. The Hook System
Hooks are user-configured automations that trigger on events:
- Lifecycle:
SessionStart,Stop,SessionEnd,Setup - Tool:
PreToolUse,PostToolUse,PostToolUseFailure - User:
UserPromptSubmit,PermissionDenied,Notification - MCP:
ElicitationRequest,ElicitationResult - Subagent:
SubagentStart,SubagentStop,TeammateIdle
Hooks execute as shell commands, HTTP endpoints, or in-process TypeScript callbacks, configured in settings.json.
Deep dive: src/utils/hooks/README.md
4. MCP (Model Context Protocol)
MCP lets Claude connect to external tool servers. An MCP server might provide database access, API integrations, or specialized tools. Claude Code includes a full MCP client supporting 6 transport types (stdio, SSE, HTTP, WebSocket, SDK, SSE-IDE).
Deep dive: src/services/mcp/README.md
5. Commands (Slash Commands)
Users type /command in the REPL to trigger actions. There are 90+ commands supporting two types:
- PromptCommand β Injects a prompt into the conversation (e.g.,
/commit,/review) - LocalJSXCommand β Renders local JSX UI (e.g.,
/config,/help)
Deep dive: src/commands/README.md
6. Skills
Skills are reusable prompts bundled as markdown files with YAML frontmatter. They can be invoked via /skill-name and inject specialized instructions into the conversation. Skills can come from:
- Bundled:
batch,claudeApi,debug,loop,simplify,skillify, etc. - User:
~/.claude/skills/ - Project:
.claude/skills/ - Plugins: From installed plugins
- MCP: From connected MCP servers
Deep dive: src/skills/README.md
7. State Management
The app uses a Zustand-style store (AppStateStore) with 450+ fields covering settings, permissions, tasks, MCP connections, UI state, and more. React components subscribe to specific slices via useAppState().
Deep dive: src/state/README.md
8. The Terminal UI (Ink)
Claude Code uses a custom fork of Ink (React for terminals) with:
- Yoga layout engine β flexbox-style layout for terminal
- DOM-style event system β keyboard, click, focus events with capture/bubble
- Custom components β Box, Text, ScrollBox, Button, Link, etc.
Deep dive: src/ink/README.md
9. Background Tasks & Sub-Agents
Claude can spawn background tasks:
- LocalAgentTask β sub-agents that run queries in parallel
- LocalShellTask β long-running shell commands
- RemoteAgentTask β agents running on remote infrastructure
- DreamTask β memory consolidation tasks
- InProcessTeammateTask β swarm teammates with shared context
Deep dive: src/tasks/README.md
10. Feature Gates
Many features are gated behind build-time flags using Bun's dead code elimination:
import { feature } from "bun:bundle";
if (feature("BRIDGE_MODE")) { /* only in bridge builds */ }
Common gates: BRIDGE_MODE, KAIROS, COORDINATOR_MODE. Gated code may reference modules not present in this extraction.
Configuration
Settings are loaded from multiple sources with precedence:
- Environment variables (highest priority)
- MDM (macOS/Windows/Linux enterprise management)
- Remote managed settings (cloud-based policies)
- Project config:
.claude/config.json - Global config:
~/.claude/config.json
Key config areas: model selection, permission mode, MCP servers, themes, keybindings, hooks, plugins.
Deep dive: src/utils/settings/README.md
Cost Tracking
Per-model pricing with cache-aware cost calculation:
cost = (inputTokens Γ inputRate) + (outputTokens Γ outputRate)
+ (cacheReadTokens Γ cacheReadRate) + (cacheWriteTokens Γ cacheWriteRate)
+ (webSearchRequests Γ $0.01)
Performance Optimizations
- Startup profiling:
profileCheckpoint()tracks timing through startup - Lazy loading: Dynamic imports for heavy modules
- Fast paths:
--version,--dump-system-promptskip full initialization - LRU caches: File state cache, skill index cache
- Parallel I/O: Keychain, MDM reads run concurrently at startup
- Streaming execution: Generator-based tool execution with concurrency
Getting Started Reading the Code
Each topic below has a comprehensive deep-dive guide in the docs/ directory, plus quick-reference links to the relevant source directories.
"I want to understand how Claude processes a user message"
In-Depth Guide: Message Processing (~1600 lines)
- Start at src/QueryEngine.ts β the main conversation loop
- Then src/query.ts β lower-level query orchestration
- Then src/services/api/README.md β how API calls are made
"I want to understand a specific tool (e.g., Bash)"
In-Depth Guide: Tool System (~700 lines)
- Go to src/tools/BashTool/README.md
- See also src/utils/bash/README.md for the security parser
"I want to understand the permission system"
In-Depth Guide: Permission System (~1000 lines)
- Start at src/utils/permissions/README.md β rule engine
- Then src/components/permissions/README.md β UI rendering
- Then src/hooks/toolPermission/README.md β React integration
"I want to understand how the terminal UI works"
In-Depth Guide: Terminal UI (~1000 lines)
- Start at src/ink/README.md β the custom renderer
- Then src/components/README.md β all UI components
- Then src/screens/README.md β top-level screens
"I want to understand MCP integration"
In-Depth Guide: MCP Integration (~1200 lines)
- Start at src/services/mcp/README.md β the MCP client
- Then src/tools/MCPTool/README.md β how MCP tools are proxied
- Then src/components/mcp/README.md β the management UI
"I want to understand the command/skill system"
In-Depth Guide: Commands & Skills (~1000 lines)
- Start at src/commands/README.md β slash command registry
- Then src/skills/README.md β skill loading and invocation
- Then src/plugins/README.md β plugin architecture
"I want to understand how settings and configuration work"
In-Depth Guide: Settings & Configuration (~1000 lines)
- Start at src/utils/settings/README.md β settings hierarchy
- Then src/utils/hooks/README.md β hook configuration
- Then src/utils/memory/README.md β CLAUDE.md memory files
"I want to understand multi-agent coordination"
In-Depth Guide: Multi-Agent Coordination (~900 lines)
- Start at src/coordinator/README.md β coordinator architecture
- Then src/utils/swarm/README.md β swarm coordination
- Then src/tasks/README.md β task types
"I want to understand remote/bridge mode"
In-Depth Guide: Remote & Bridge Mode (~700 lines)
- Start at src/bridge/README.md β bridge protocol
- Then src/server/README.md β Direct Connect server
- Then src/remote/README.md β remote execution
Directory Index
Every directory in the project has its own README.md with detailed documentation. Click any link to dive deeper.
Core Engine
- src/ β Source root overview
- src/entrypoints/ β Application entry points (CLI, SDK, MCP server)
- src/entrypoints/sdk/ β SDK type exports
- src/bootstrap/ β Startup initialization
- src/query/ β Query system modules
- src/state/ β Global state store (450+ fields)
- src/context/ β React contexts (9 context files)
- src/schemas/ β Zod validation schemas
Tools (42+)
- src/tools/ β Tool system overview and registry
- src/tools/AgentTool/ β Sub-agent spawning
- src/tools/AgentTool/built-in/ β Built-in agent types
- src/tools/AskUserQuestionTool/ β Interactive questions
- src/tools/BashTool/ β Shell command execution
- src/tools/BriefTool/ β Brief responses
- src/tools/ConfigTool/ β Configuration access
- src/tools/EnterPlanModeTool/ β Plan mode entry
- src/tools/EnterWorktreeTool/ β Git worktree isolation
- src/tools/ExitPlanModeTool/ β Plan mode exit
- src/tools/ExitWorktreeTool/ β Worktree cleanup
- src/tools/FileEditTool/ β Surgical file edits
- src/tools/FileReadTool/ β File reading
- src/tools/FileWriteTool/ β File creation
- src/tools/GlobTool/ β File pattern matching
- src/tools/GrepTool/ β Content search (ripgrep)
- src/tools/LSPTool/ β Language server integration
- src/tools/ListMcpResourcesTool/ β MCP resource listing
- src/tools/MCPTool/ β MCP tool proxy
- src/tools/McpAuthTool/ β MCP authentication
- src/tools/NotebookEditTool/ β Jupyter notebook editing
- src/tools/PowerShellTool/ β PowerShell execution
- src/tools/REPLTool/ β REPL execution
- src/tools/ReadMcpResourceTool/ β MCP resource reading
- src/tools/RemoteTriggerTool/ β Remote trigger management
- src/tools/ScheduleCronTool/ β Cron scheduling
- src/tools/SendMessageTool/ β Inter-agent messaging
- src/tools/SkillTool/ β Skill invocation
- src/tools/SleepTool/ β Sleep/delay
- src/tools/SyntheticOutputTool/ β Synthetic output
- src/tools/TaskCreateTool/ β Task creation
- src/tools/TaskGetTool/ β Task status
- src/tools/TaskListTool/ β Task listing
- src/tools/TaskOutputTool/ β Task output retrieval
- src/tools/TaskStopTool/ β Task stopping
- src/tools/TaskUpdateTool/ β Task updating
- src/tools/TeamCreateTool/ β Team creation
- src/tools/TeamDeleteTool/ β Team deletion
- src/tools/TodoWriteTool/ β Task list management
- src/tools/ToolSearchTool/ β Tool search
- src/tools/WebFetchTool/ β Web page fetching
- src/tools/WebSearchTool/ β Web search
- src/tools/shared/ β Shared tool utilities
- src/tools/testing/ β Testing utilities
Commands (90+)
- src/commands/ β Command system overview
- src/commands/add-dir/ β Add working directories
- src/commands/agents/ β Agent management
- src/commands/ant-trace/ β Internal tracing
- src/commands/autofix-pr/ β PR auto-fix
- src/commands/backfill-sessions/ β Session backfill
- src/commands/branch/ β Conversation forking
- src/commands/break-cache/ β Cache clearing
- src/commands/bridge/ β Bridge connection
- src/commands/btw/ β Side questions
- src/commands/bughunter/ β Bug hunting
- src/commands/chrome/ β Chrome extension
- src/commands/clear/ β Session reset
- src/commands/color/ β Prompt color
- src/commands/compact/ β Context compression
- src/commands/config/ β Settings panel
- src/commands/context/ β Context visualization
- src/commands/copy/ β Clipboard copy
- src/commands/cost/ β Session cost
- src/commands/ctx_viz/ β Context visualization (internal)
- src/commands/debug-tool-call/ β Tool call debugging
- src/commands/desktop/ β Desktop handoff
- src/commands/diff/ β Diff viewer
- src/commands/doctor/ β Installation diagnostics
- src/commands/effort/ β Effort level
- src/commands/env/ β Environment info
- src/commands/exit/ β Exit REPL
- src/commands/export/ β Conversation export
- src/commands/extra-usage/ β Overage billing
- src/commands/fast/ β Fast mode toggle
- src/commands/feedback/ β Bug reports
- src/commands/files/ β Files in context
- src/commands/good-claude/ β Positive feedback
- src/commands/heapdump/ β Heap dump (debug)
- src/commands/help/ β Help screen
- src/commands/hooks/ β Hook configuration
- src/commands/ide/ β IDE integration
- src/commands/install-github-app/ β GitHub Actions setup
- src/commands/install-slack-app/ β Slack app install
- src/commands/issue/ β Issue tracking
- src/commands/keybindings/ β Keybinding config
- src/commands/login/ β Authentication
- src/commands/logout/ β Sign out
- src/commands/mcp/ β MCP server management
- src/commands/memory/ β Memory management
- src/commands/mobile/ β Mobile setup
- src/commands/mock-limits/ β Mock rate limits
- src/commands/model/ β Model selection
- src/commands/oauth-refresh/ β OAuth refresh
- src/commands/onboarding/ β Onboarding
- src/commands/output-style/ β Output formatting
- src/commands/passes/ β Guest passes
- src/commands/perf-issue/ β Performance issues
- src/commands/permissions/ β Permission rules
- src/commands/plan/ β Plan mode
- src/commands/plugin/ β Plugin management
- src/commands/pr_comments/ β PR comments
- src/commands/privacy-settings/ β Privacy settings
- src/commands/rate-limit-options/ β Rate limits
- src/commands/release-notes/ β Release notes
- src/commands/reload-plugins/ β Reload plugins
- src/commands/remote-env/ β Remote environment
- src/commands/remote-setup/ β Remote setup
- src/commands/rename/ β Session rename
- src/commands/reset-limits/ β Reset rate limits
- src/commands/resume/ β Resume session
- src/commands/review/ β Code review
- src/commands/rewind/ β Conversation rewind
- src/commands/sandbox-toggle/ β Sandbox toggle
- src/commands/session/ β Session management
- src/commands/share/ β Session sharing
- src/commands/skills/ β Skills browser
- src/commands/stats/ β Usage statistics
- src/commands/status/ β Status display
- src/commands/stickers/ β Stickers
- src/commands/summary/ β Session summary
- src/commands/tag/ β Session tagging
- src/commands/tasks/ β Task management
- src/commands/teleport/ β Session teleport
- src/commands/terminalSetup/ β Terminal setup
- src/commands/theme/ β Theme selection
- src/commands/thinkback/ β Think-back
- src/commands/thinkback-play/ β Think-back playback
- src/commands/upgrade/ β Upgrade Claude Code
- src/commands/usage/ β Usage info
- src/commands/vim/ β Vim mode toggle
- src/commands/voice/ β Voice input toggle
User Interface
- src/components/ β All 146+ components
- src/components/ui/ β UI primitives
- src/components/Settings/ β Settings dialog
- src/components/LspRecommendation/ β LSP recommendations
- src/components/tasks/ β Task monitoring
- src/components/messages/ β Message renderers (30+)
- src/components/messages/UserToolResultMessage/ β Tool result display
- src/components/memory/ β Memory UI
- src/components/ClaudeCodeHint/ β Plugin hints
- src/components/ManagedSettingsSecurityDialog/ β Security dialogs
- src/components/shell/ β Shell output rendering
- src/components/FeedbackSurvey/ β Feedback collection
- src/components/Passes/ β Guest passes UI
- src/components/grove/ β Terms of service
- src/components/wizard/ β Multi-step wizard
- src/components/agents/ β Agent management UI
- src/components/agents/new-agent-creation/ β Agent creation wizard
- src/components/agents/new-agent-creation/wizard-steps/ β Wizard steps
- src/components/diff/ β Diff viewing
- src/components/mcp/ β MCP management UI
- src/components/mcp/utils/ β MCP utilities
- src/components/Spinner/ β Animated spinners
- src/components/sandbox/ β Sandbox UI
- src/components/permissions/ β Permission dialogs
- src/components/permissions/BashPermissionRequest/ β Bash approval
- src/components/permissions/PowerShellPermissionRequest/ β PowerShell approval
- src/components/permissions/SedEditPermissionRequest/ β Sed edit approval
- src/components/permissions/FileEditPermissionRequest/ β File edit approval
- src/components/permissions/FileWritePermissionRequest/ β File write approval
- src/components/permissions/FilesystemPermissionRequest/ β Filesystem access
- src/components/permissions/NotebookEditPermissionRequest/ β Notebook approval
- src/components/permissions/ComputerUseApproval/ β Computer use
- src/components/permissions/AskUserQuestionPermissionRequest/ β Question approval
- src/components/permissions/WebFetchPermissionRequest/ β Web fetch approval
- src/components/permissions/FilePermissionDialog/ β File permission dialog
- src/components/permissions/SkillPermissionRequest/ β Skill approval
- src/components/permissions/EnterPlanModePermissionRequest/ β Plan mode entry
- src/components/permissions/ExitPlanModePermissionRequest/ β Plan mode exit
- src/components/permissions/rules/ β Rule management UI
- src/components/DesktopUpsell/ β Desktop promotion
- src/components/TrustDialog/ β Trust verification
- src/components/hooks/ β Hooks browser
- src/components/StructuredDiff/ β Word-level diffs
- src/components/HelpV2/ β Help dialog
- src/components/teams/ β Team management
- src/components/skills/ β Skills browser
- src/components/CustomSelect/ β Selection input
- src/components/PromptInput/ β User input area
- src/components/design-system/ β Design system primitives
- src/components/LogoV2/ β Startup logo
- src/components/HighlightedCode/ β Syntax highlighting
Terminal Renderer (Ink)
- src/ink/ β Custom Ink overview
- src/ink/layout/ β Yoga layout engine
- src/ink/components/ β Core Ink components
- src/ink/hooks/ β Ink hooks (12 hooks)
- src/ink/events/ β DOM-style event system
- src/ink/termio/ β Terminal I/O (ANSI, CSI, SGR, etc.)
Services (20)
- src/services/ β Service overview
- src/services/api/ β Claude API client (4 providers)
- src/services/mcp/ β MCP client (6 transports)
- src/services/analytics/ β Event analytics
- src/services/compact/ β Conversation compaction
- src/services/extractMemories/ β Memory extraction
- src/services/lsp/ β Language Server Protocol
- src/services/oauth/ β OAuth 2.0 PKCE
- src/services/plugins/ β Plugin installation
- src/services/policyLimits/ β Enterprise policies
- src/services/remoteManagedSettings/ β Managed settings
- src/services/AgentSummary/ β Agent progress summaries
- src/services/SessionMemory/ β Session notes
- src/services/PromptSuggestion/ β Follow-up suggestions
- src/services/settingsSync/ β Settings sync
- src/services/tips/ β Contextual tips
- src/services/tools/ β Tool execution orchestration
- src/services/autoDream/ β Memory consolidation
- src/services/teamMemorySync/ β Team memory sync
- src/services/toolUseSummary/ β Tool batch summaries
- src/services/MagicDocs/ β Auto-updating docs
Infrastructure
- src/cli/ β CLI infrastructure
- src/cli/transports/ β Transport layer (SSE, WebSocket, Hybrid)
- src/cli/handlers/ β Subcommand handlers
- src/bridge/ β Remote bridge mode (CCR)
- src/coordinator/ β Multi-agent coordinator
- src/server/ β Direct Connect server
- src/remote/ β Remote execution
Task System
- src/tasks/ β Task system overview
- src/tasks/LocalAgentTask/ β Local sub-agents
- src/tasks/LocalShellTask/ β Shell tasks
- src/tasks/RemoteAgentTask/ β Remote agents
- src/tasks/DreamTask/ β Memory consolidation
- src/tasks/InProcessTeammateTask/ β Teammate tasks
Skills & Plugins
- src/skills/ β Skills system
- src/skills/bundled/ β Bundled skills
- src/plugins/ β Plugin system
- src/plugins/bundled/ β Bundled plugins
React Hooks (76+)
- src/hooks/ β All React hooks
- src/hooks/notifs/ β Notification hooks (16)
- src/hooks/toolPermission/ β Permission checking
- src/hooks/toolPermission/handlers/ β Permission handlers
Utilities (331+)
- src/utils/ β Utility overview
- src/utils/background/ β Background tasks
- src/utils/background/remote/ β Remote sessions
- src/utils/bash/ β Bash parser & security
- src/utils/bash/specs/ β Command specs
- src/utils/claudeInChrome/ β Chrome extension
- src/utils/computerUse/ β Computer use
- src/utils/deepLink/ β Deep links
- src/utils/dxt/ β DXT manifest validation
- src/utils/filePersistence/ β File upload
- src/utils/git/ β Git utilities
- src/utils/github/ β GitHub CLI auth
- src/utils/hooks/ β Hook execution engine (26 events)
- src/utils/memory/ β Memory types & CLAUDE.md
- src/utils/messages/ β Message mapping
- src/utils/mcp/ β MCP utilities
- src/utils/model/ β Model selection
- src/utils/nativeInstaller/ β Self-update system
- src/utils/permissions/ β Permission rule engine
- src/utils/plugins/ β Plugin loading
- src/utils/powershell/ β PowerShell parsing
- src/utils/processUserInput/ β Input routing
- src/utils/sandbox/ β Sandbox adapter
- src/utils/secureStorage/ β Credential storage
- src/utils/settings/ β Settings hierarchy
- src/utils/settings/mdm/ β MDM profiles
- src/utils/shell/ β Shell provider
- src/utils/skills/ β Skill file watching
- src/utils/suggestions/ β Fuzzy command search
- src/utils/swarm/ β Multi-agent swarm
- src/utils/swarm/backends/ β Swarm backends (tmux, iTerm2)
- src/utils/task/ β Task framework
- src/utils/telemetry/ β OpenTelemetry
- src/utils/teleport/ β Session teleporting
- src/utils/todo/ β Todo schemas
- src/utils/ultraplan/ β Remote planning
Data & Types
- src/constants/ β Application constants (21 files)
- src/types/ β TypeScript types
- src/types/generated/ β Generated protobuf types
- src/migrations/ β Data migrations (11 files)
- src/native-ts/ β Native TS ports
Specialized Features
- src/screens/ β Top-level screens (REPL, Doctor, Resume)
- src/outputStyles/ β Output formatting
- src/vim/ β Vim mode
- src/voice/ β Voice input
- src/keybindings/ β Keybinding system
- src/buddy/ β Companion pet system
- src/memdir/ β Persistent memory
- src/assistant/ β Session history client
- src/upstreamproxy/ β Upstream proxy
- src/moreright/ β Internal feature stub
License
This documentation is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
You are free to share and adapt the material for any purpose, even commercially, as long as you give appropriate credit.
Disclaimer: This license covers the original documentation only. Claude Code and all related software are the property of Anthropic, PBC and are not covered by this license.
