You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Claude Code is Anthropic's AI-powered coding assistant that runs as:
A CLI tool in the terminal
A VS Code extension
A JetBrains plugin
A desktop app (Mac/Windows)
A web app (claude.ai/code)
It allows developers to interact with Claude directly in their development environment — Claude can read files, write code, run shell commands, search codebases, and perform complex multi-step software engineering tasks autonomously.
Repository Stats
~1,900 TypeScript files
~513,000 lines of code
Full client-side implementation — CLI, UI, tools, agent system, and more
Architecture Overview
Core Engine
Directory
Description
coordinator/
The main orchestration loop — manages conversation turns, decides when to invoke tools, handles agent execution flow
QueryEngine.ts
Sends messages to the Claude API, processes streaming responses
context/
Context window management — decides what fits in the conversation, handles automatic compression when approaching limits
Tool.ts / tools.ts
Tool registration, dispatch, and base tool interface
Tools (The Core Power of Claude Code)
Each tool lives in its own directory under tools/ with its implementation, description, and parameter schema:
Tool
Purpose
BashTool/
Execute shell commands
FileReadTool/
Read files from the filesystem
FileEditTool/
Make targeted edits to existing files
FileWriteTool/
Create or overwrite files
GlobTool/
Find files by pattern (e.g., **/*.ts)
GrepTool/
Search file contents with regex
AgentTool/
Spawn autonomous sub-agents for complex tasks
WebSearchTool/
Search the web
WebFetchTool/
Fetch content from URLs
NotebookEditTool/
Edit Jupyter notebooks
TodoWriteTool/
Track task progress
ToolSearchTool/
Dynamically discover deferred tools
MCPTool/
Call Model Context Protocol servers
LSPTool/
Language Server Protocol integration
TaskCreateTool/
Create background tasks
EnterPlanModeTool/
Switch to planning mode
SkillTool/
Execute reusable skill prompts
SendMessageTool/
Send messages to running sub-agents
Terminal UI (Custom Ink-based Renderer)
Directory
Description
ink/
Custom terminal rendering engine built on Ink/React with Yoga layout. Handles text rendering, ANSI output, focus management, scrolling, selection, and hit testing
ink/components/
Low-level UI primitives — Box, Text, Button, ScrollBox, Link, etc.
ink/hooks/
React hooks for input handling, animation, terminal state