wuwangzhang1216/claude-code-source-all-in-one

View on GitHub ↗

Always up-to-date open-source mirror of Claude Code (currently v2.1.152). Run from source with Claude subscription/API, ChatGPT subscription (GPT-5.5 / GPT-5.4), OpenAI-compatible providers, or local Ollama. 18 deep-dive architecture articles included. For educational and reference purposes only.

90 ★95 forksTypeScriptUpdated 3mo ago

What you need to know

Educational repository containing extracted Anthropic Claude Code source code and 18 original bilingual deep-analysis articles, runnable from source with Bun.

Install

node scripts/setup.mjs
npm install -g @anthropic-ai/claude-code

Usage

  • ./start.sh login (Claude subscription OAuth)
  • ./start.sh
  • export ANTHROPIC_API_KEY="sk-ant-xxx" && ./start.sh
  • ollama pull qwen2.5-coder:7b && ./start-ollama.sh qwen2.5-coder:7b

Key features

  • Extracted Claude Code source (query loop, QueryEngine, 45+ tools, permission system, MCP integration)
  • 18 deep-dive articles in English and Chinese covering agent loop, streaming, tool orchestration, context window, MCP, memory
  • Runnable from source via Bun with runtime shims (feature flags, macros)
  • Supports Claude subscription, Anthropic/OpenAI/DeepSeek/Mistral API keys, and local Ollama models
  • Tracks upstream releases (aligned with a specific Claude Code version)

Best for

Engineers and researchers studying how a production-grade AI agent is architected

Caveats

  • Strictly educational; all source rights belong to Anthropic and no license is granted to the code
  • Commercial use, redistribution, or building competing products is prohibited
  • Run-from-source has reduced functionality and missing private packages (computer use, sandbox, MCP bridge)
  • Requires Node.js >= 18, Bun >= 1.0, and an auth method (subscription or API key)
Platforms: macOS · Linux · WindowsClients: Claude Code
Documentation ↗

Reviewed 2026-08-11

Topics

ai-agentai-codinganthropicarchitecture-analysischatgptclaudeclaude-codeclideep-analysisdeepseekgptllmmcpmodel-context-protocolopenaiopenai-apisource-codetypescript
Stars
90★
Forks
95
Language
TypeScript
License
Created
2026-03-31
Last push
2026-05-28