A comprehensive bilingual analysis of Anthropic's AI-powered CLI tool. Explore 1,884 TypeScript files, 45+ tools, multi-agent orchestration, and sophisticated architecture.
Explore all 1,884 files with full syntax-highlighted source code, file summaries, and project context.
Click "Ask AI" on any file to get a detailed AI-powered analysis of its purpose, functions, and design patterns.
Select any code snippet on any page — a tooltip appears instantly with "Explain" and "Ask" buttons powered by AI.
Claude Code is Anthropic's official AI-powered CLI tool - internally codenamed "Tengu". It's a production-grade AI agent framework containing 1,884 TypeScript files across 55+ directories.
Built on Bun runtime with Node.js v18+ fallback. Uses TypeScript/TSX with Bun's native bundler and dead-code elimination via feature() flags.
Custom React-based terminal renderer with 96 files. Features Yoga layout engine, ANSI colors, keyboard/mouse handling, and responsive terminal layouts.
Deep integration with @anthropic-ai/sdk for Claude API. Supports streaming, extended thinking, web search betas, prompt caching, and multi-model fallback.
React Context-based state with custom stores. Includes session persistence, conversation recovery, memory consolidation, and settings change detection.
Full Model Context Protocol support with 25+ files. Server registry, OAuth integration, resource management, and enterprise XAA authentication.
Two-way VS Code bridge with 31 files (up to 2,999 lines). Supports file operations, terminal control, permission prompts, and real-time status updates.
The core architecture follows a layered design with CLI entry, LLM orchestration, tool execution, and API communication.
Claude Code includes a comprehensive toolkit spanning file operations, code execution, web search, agent management, and more.
Reads files with PDF, notebook, and image support. Line limiting and compression.
Multi-operation file editing: insert, delete, replace with safe diffing.
Atomic file creation with permission checking and validation.
Pattern-based file discovery across the codebase.
Content search with regex and multiline support.
Shell command execution with streaming, environment control, and 98KB security validation.
Windows PowerShell execution with 16 supporting files.
Jupyter notebook cell operations - create, edit, and run cells.
Spawns sub-agents with independent sessions for parallel work.
Creates agent teams for coordinated multi-agent work.
Inter-agent messaging for team communication.
Executes MCP skills and custom prompts/plugins.
Web search via Claude's native web_search tool.
HTTP fetch with HTML to Markdown conversion.
Discovers and searches available tools dynamically.
Creates structured task entries with metadata.
Updates task status: pending, in_progress, completed.
Creates cron schedules for recurring tasks.
Schedules remote async agent execution.
Enables extended planning sessions with 30-minute budget.
Creates isolated git worktree for safe experimentation.
Prompts the user for input when clarification is needed.
A full Tamagotchi-style companion system with 18 species, 5 rarity tiers, deterministic generation using Mulberry32 PRNG seeded from userId, customizable eyes/hats, and AI-generated personality (Soul).
Background memory consolidation via a subagent. The system Orients (reads MEMORY.md), Gathers (finds signals from daily logs), Consolidates (updates durable memory), and Prunes (keeps context efficient). Runs as a 30-minute background Opus session.
An "always-on" proactive AI assistant that watches logs for signals and acts without waiting for explicit user input. Runs as a background agent with push notification support and GitHub webhook subscriptions.
Multi-agent orchestration enabling team-based task execution. Spawns worker agents for parallel work with internal-only tools: TeamCreate, TeamDelete, SendMessage, SyntheticOutput.
Remote Opus 4.6 session for complex tasks. Offloads to cloud for up to 30 minutes of deep planning, handling complex multi-step problems, then teleports context back to the main session.
Safety system for Anthropic employees contributing to public repos. Auto-strips model codenames, internal project names, attribution lines, and blocks internal info from commits.
Native Vim keybindings with motions, operators, text objects, and full mode transitions (insert, normal, visual).
98KB validation module that detects dangerous commands: rm, dd, mkfs, shutdown. Includes variable substitution checks and destructive pattern detection.
43KB path validation system ensuring file operations stay within authorized directories and preventing path traversal attacks.
68KB read-only validation module that classifies tools and operations as safe for read-only execution.
Multi-level permission system: Default (prompt user), Auto (AI auto-approves safe ops), Bypass (user confirms all). 17+ permission files.
| Flag | Purpose | Status |
|---|---|---|
KAIROS |
Proactive assistant mode | Internal |
COORDINATOR_MODE |
Multi-agent team orchestration | Internal |
VOICE_MODE |
Voice input/output (STT) | Beta |
BRIDGE_MODE |
IDE bridge integration | Active |
TRANSCRIPT_CLASSIFIER |
Auto-mode permission classification | Internal |
DIRECT_CONNECT |
Direct API connection mode | Beta |
SSH_REMOTE |
SSH remote execution | Beta |