Directory · Coding agents
Claude Code From Scratch
Step-by-step tutorial rebuilding Claude Code's core architecture in about 5000 lines of TypeScript and Python.
★ 2,851 stars · last updated 2026-11-09 · Free, open source · View on GitHub
Best for
- Developers learning how coding agents work internally
- Building a minimal custom coding agent as a starting point
- Studying agent loops, context compaction, permissions, and MCP integration
- Experimenting with Anthropic or OpenAI-compatible backends
Install
git clone https://github.com/Windy3f3f3f3f/claude-code-from-scratch.git
cd claude-code-from-scratch
npm install && npm run build
Our take
An educational project with 13+ chapters, each with a runnable minimal implementation that uses a local mock model and needs no API key. It reimplements observed Claude Code behavior (13 tools, 4-layer compaction, memory, skills, sub-agents, MCP) but does not claim to match the real internals and is not affiliated with Anthropic. Primary documentation is in Chinese, with an English README and tutorial available.
Similar coding agents
- Open Interpreter: Terminal coding agent forked from OpenAI Codex, tuned to emulate provider harnesses for low-cost open models like Kimi K3 and GLM.
- AI Agents in Depth (深入理解 AI Agent): Open-source book by Bojie Li on AI agent design and engineering, with 10 chapters and 109 companion experiments in Python.
- Codewhale: Open-source Rust terminal coding agent that works with 40+ model providers or local models, with approvals, receipts and undo.
- Reasonix: Open-source coding agent for terminal, desktop, browser and editor that reads code, edits files and runs commands with any OpenAI-compatible model.
- DSH Go: Unofficial Android client for DeepSeek Harness that runs the agent on-device or remotely controls DSH on your computer.
- Qwen Code: Open-source terminal coding agent with IDE, desktop, web, and chat interfaces, supporting Qwen, OpenAI, Anthropic, Gemini, and local models.