# Claude Code from Scratch

> 用约 5000 行代码，从零手写一个 Claude Code（学习用的最小实现）

- 13 章分步教程，每一步附**架构对照视角**，便于扩展研究
- **每个代码章都能一条命令跑起来，不用 API key**——`node steps/run.mjs <章号>`
- 覆盖 Agent Loop、工具系统、流式输出、上下文压缩、记忆/技能/多 Agent
- **TypeScript / Python 两个版本分别实现**，Anthropic / OpenAI 双后端，跨平台

[开始阅读](docs/00-introduction.md)
[GitHub](https://github.com/Windy3f3f3f3f/claude-code-from-scratch)
