Claude Code Sourcemap Learning Notebook
Description
Reverse-engineering Claude Code's 512K+ lines of TypeScript — architecture, design decisions, and 11 transferable patterns for building AI Agents
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Claude Code Sourcemap Learning Notebook
[](https://github.com/dadiaomengmeimei/claude-code-sourcemap-learning-notebook) [](LICENSE)
🌐 [中文版 / Chinese Version](README_CN.md)
**Reverse-engineering Claude Code's 512K+ lines of TypeScript — extracting the architecture, design decisions, and 11 transferable patterns that make a production AI Agent work.**
Not just a code walkthrough. An architectural analysis that explains *why* each design choice was made, with alternatives compared.
What You'll Learn
- 🔄 Query Loop — Streaming tool execution, read-write lock concurrency, 3-layer AbortController cascade
- 🛠️ Tool System —
buildTool()factory + Zod schema as prompt, 40+ tools with 18+ feature flags - 🔒 5-Layer Security — Permission rules → mode → tool checks → path safety → macOS Seatbelt sandbox
- 🤖 Multi-Agent — Coordinator orchestration, default isolation with explicit sharing, cache-friendly forking
- 🔌 MCP & Skills — 3-layer skill architecture, bundled skill lazy extraction,
/simplify3-agent parallel review - 🧠 Prompt Engineering — 7 categories with 40+ prompt files, static/dynamic separation for cache optimization
- 🎙️ Voice & Buddy — Record-first-connect-later latency elimination, deterministic generation
Chapters
| # | Topic | Core Source Files | Time |
|---|---|---|---|
| 00 | Index & Architecture Overview | — | 10min |
| 01 | Global Architecture | main.tsx, App.tsx, QueryEngine.ts |
30min |
| 02 | Tool System | Tool.ts, tools.ts, GlobTool.ts |
45min |
| 03 | Permission & Security | permissions.ts, filesystem.ts |
45min |
| 04 | Query Loop & API ⭐ | query.ts, `StreamingToo |
Related Skills
Agency Agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy inject
AI Firecrawl
🔥 The API to search, scrape, and interact with the web for AI
AI Artifacts Builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web tech
AI CrewAI
Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewA
AI TrendRadar
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的
AI mem0
| Universal memory layer for AI Agents | 51341 | 221 | 1 |
AI