Content
# Tool List
> Claude Code CLI Source Code Analysis Project
## Project Introduction
This is the source code of the official Anthropic **Claude Code CLI** tool for learning, research, and analysis purposes. Claude Code is a powerful AI programming assistant command-line tool that supports automation of various programming tasks.
## Technology Stack
| Category | Technology |
|------|------|
| **Language** | TypeScript / TSX |
| **Runtime** | Bun |
| **UI Framework** | Ink (React for CLI) |
| **Package Manager** | Bun |
| **CLI Framework** | Commander.js |
| **Terminal Style** | Chalk |
## Project Structure
```
src/
├── commands/ # Command implementations (/commit, /review, etc.)
├── components/ # UI components (based on Ink React)
│ └── design-system/ # Design system components
├── services/ # Core services
│ ├── api/ # API services
│ ├── mcp/ # MCP protocol implementation
│ ├── analytics/ # Analytics services
│ └── settingsSync/ # Settings synchronization
├── tools/ # Tool implementations
│ ├── BashTool/ # Shell command execution
│ ├── FileReadTool/ # File reading
│ ├── FileEditTool/ # File editing
│ ├── GrepTool/ # Code search
│ ├── GlobTool/ # File matching
│ ├── TaskTool/ # Task agent
│ └── ... # More tools
├── hooks/ # React Hooks
├── constants/ # Constant definitions
├── ink/ # Terminal UI framework
├── utils/ # Utility functions
├── schemas/ # JSON Schema definitions
├── screens/ # Screen components
├── plugins/ # Plugin system
├── keybindings/ # Shortcut key bindings
└── main.tsx # Main entry file
```
## Core Features
### Command List
#### Git & Code Management
| Command | Description |
|------|------|
| `/commit` | Intelligent Git commit generation |
| `/review` | Code review |
| `/pr_comments` | PR comment analysis |
| `/diff` | Difference viewing |
| `/branch` | Branch management |
#### Session Management
| Command | Description |
|------|------|
| `/resume` | Resume historical sessions |
| `/session` | Session management |
| `/clear` | Clear conversation |
| `/compact` | Compress context |
| `/rewind` | Rewind operation |
| `/export` | Export session |
#### Configuration & Settings
| Command | Description |
|------|------|
| `/config` | Configuration management |
| `/init` | Initialize project |
| `/model` | Switch model |
| `/theme` | Theme settings |
| `/login` | Login account |
| `/logout` | Logout account |
#### MCP & Plugins
| Command | Description |
|------|------|
| `/mcp` | MCP server management |
| `/plugin` | Plugin management |
| `/skills` | Skill system |
#### Tools & Diagnostics
| Command | Description |
|------|------|
| `/doctor` | System diagnosis |
| `/cost` | Cost statistics |
| `/usage` | Usage statistics |
| `/help` | Help information |
| `/upgrade` | Upgrade version |
#### Mode Switching
| Command | Description |
|------|------|
| `/vim` | Vim mode |
| `/plan` | Plan mode |
| `/fast` | Fast mode |
| `/permissions` | Permission management |
| `/hooks` | Hook configuration |
## Architecture Highlights
### 1. Tool System (Tools)
Each tool is an independent module, including:
- Input validation (JSON Schema)
- Execution logic
- Permission control
- Output formatting
### 2. Command System (Commands)
Supports multiple command types:
- `prompt` - Prompt command
- `local` - Local execution command
- `dialog` - Dialog command
### 3. MCP Protocol
Complete Model Context Protocol implementation, supporting:
- Stdio transmission
- SSE transmission
- Resource management
- Tool invocation
### 4. Skill System (Skills)
Extensible skill framework:
- Built-in skills
- Plugin skills
- Custom skill directory
### 5. Agent System (Agents)
Multi-agent collaboration support:
- Task agent
- Parallel execution
- Context isolation
## Code Statistics
| Indicator | Quantity |
|------|------|
| TypeScript files | ~1884 |
| Command quantity | ~50+ |
| Tool quantity | ~30+ |
| UI components | ~100+ |
## Key Files
| File | Description |
|------|------|
| `main.tsx` | Application main entry |
| `commands.ts` | Command registration center |
| `tools.ts` | Tool registration center |
| `context.ts` | Context management |
| `ink.tsx` | UI rendering engine |
## Dependency Relationship
```
main.tsx
├── commands.ts ──► commands/
├── tools.ts ──► tools/
├── services/
│ ├── api/
│ ├── mcp/
│ └── analytics/
└── components/
└── design-system/
```
## Learning Value
1. **CLI Application Architecture** - Large command-line tool design patterns
2. **React Terminal UI** - Ink framework practical application
3. **MCP Protocol** - AI tool interconnection protocol implementation
4. **Plugin System** - Extensible architecture design
5. **Agent System** - Multi-agent collaboration mode
## Disclaimer
This project is for learning and research purposes only. Claude Code is a product of Anthropic, PBC. This repository does not contain complete build configurations and dependencies, only source code for learning and analysis.
## License
Source code copyright belongs to Anthropic, PBC. This project is for educational purposes only.
---
> Last updated: 2026-03-31
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
n8n
n8n is a workflow automation platform for technical teams, combining code...
ollama
Get up and running with OpenAI gpt-oss, DeepSeek-R1, Gemma 3 and other models.
open-webui
Open WebUI is an extensible web interface for various applications.
dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.
NextChat
NextChat is a light and fast AI assistant supporting Claude, DeepSeek, GPT4...
zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
Cline
Cline is a versatile tool available on VS Marketplace for enhancing...
anything-llm
AnythingLLM: An all-in-one AI app for chatting with documents and using AI agents.
goose
Goose is an open-source AI agent that automates engineering tasks autonomously.
cherry-studio
🍒 Cherry Studio is a desktop client that supports for multiple LLM providers.