Key capabilities
File editing
Read, write, and apply AI-powered edits to files. Supports range reading, full rewrites, and structured diffs.
Shell execution
Run shell commands with intelligent sandboxing. Executes bash commands, scripts, and manages your dev environment.
Codebase search
Search code using ripgrep (grep), glob patterns, and the Language Server Protocol for precise navigation.
MCP integration
Connect to Model Context Protocol servers to extend Claude Code with custom tools and data sources.
Multi-agent orchestration
Spawn sub-agents, create agent teams, and coordinate parallel workstreams using the swarm system.
Voice mode
Input prompts via speech-to-text with real-time streaming and voice keyterm detection.
Architecture overview
Claude Code is built around a central agentic loop that drives all interactions. Query loop — The core of Claude Code is an async generator function inquery.ts that manages the model call → tool execution → model call cycle. It handles context compaction, token budget tracking, streaming tool execution, and automatic recovery from API errors.
Tool system — Over 40 built-in tools implement a common interface defined in Tool.ts. Each tool is independently sandboxed and subject to the permission system. Tools cover file I/O, shell execution, web search, MCP proxying, agent spawning, Jupyter notebooks, and more.
Slash commands — Over 100 slash commands (e.g., /init, /commit, /review, /doctor) are registered via commands.ts and provide structured workflows on top of the query loop.
Hooks system — An event-driven lifecycle system (utils/hooks.ts) allows external scripts to intercept tool calls, modify behavior, and automate responses to Claude Code events. Hooks can approve or deny tool usage and respond to file change events.
Technology stack
| Technology | Role |
|---|---|
| TypeScript | Primary language across all 1,884 source files |
| Bun | Runtime and bundler — feature flags use bun:bundle for dead-code elimination |
| React / Ink | Terminal UI framework powering 140+ UI components and the full REPL screen |
| Commander.js | CLI argument parsing via @commander-js/extra-typings |
| Anthropic SDK | Official Claude API client |
| Zod | Runtime schema validation |
| MCP SDK | Model Context Protocol client for server integrations |
Internal codename
Claude Code’s internal project name is Tengu — visible as thetengu_* prefix on all analytics events logged through the telemetry pipeline. The codebase also references feature-flagged internal builds that differ from the public @anthropic-ai/claude-code npm package.
The public package is distributed as a compiled JavaScript bundle. Feature flags using
bun:bundle perform dead-code elimination so internal-only features (COORDINATOR_MODE, VOICE_MODE, BRIDGE_MODE, etc.) are stripped from external builds.Next steps
Quickstart
Get Claude Code running in your terminal in minutes.
Installation
Full installation instructions, environment variables, and platform notes.