You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Infrastructure:
- Fix devcontainer features to use existing community images
- Add VitePress head/meta for SEO and social sharing
- Add English locale outline and docFooter config
Demo code:
- Remove unnecessary @anthropic-ai/sdk dependency (defer to Ch3)
- Add PermissionRuleSource type and source field to PermissionRule
- Add ToolCategory type and category field to Tool interface
- Extract DEFAULT_MODEL constant in config.ts
Documentation:
- Enhance Ch1 Section 7 with config explanations and troubleshooting FAQ
- Make Ch1 "What's Next" preview more specific with concrete deliverables
- Add "Key Milestones" section to both README files (zh-CN and en)
- Sync all changes between Chinese and English versions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+93Lines changed: 93 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@ Claude Code is more than a chatbot wrapper. It's a full-featured terminal applic
24
24
25
25
Understanding its source is a masterclass in building production-grade AI applications.
26
26
27
+
**Build as you learn.** This isn't just documentation — it's a progressive tutorial. Starting from Chapter 1, you'll build `mini-claude`, a working clone of Claude Code. Each chapter adds a new module to the demo. By Chapter 12, you'll have a fully functional AI coding assistant with tools, permissions, terminal UI, and more.
28
+
27
29
---
28
30
29
31
## Learning Roadmap
@@ -45,6 +47,87 @@ Understanding its source is a masterclass in building production-grade AI applic
45
47
46
48
---
47
49
50
+
## The Demo: mini-claude
51
+
52
+
As you read each chapter, you'll build `mini-claude` — a working AI coding assistant that mirrors Claude Code's real architecture. The demo lives in the `demo/` directory and grows chapter by chapter.
53
+
54
+
### Final Architecture
55
+
56
+
```
57
+
demo/
58
+
├── main.ts # CLI entry (Commander.js)
59
+
├── context.ts # System prompt builder
60
+
├── query.ts # Query loop (stream + tool calls)
61
+
├── Tool.ts # Tool interface & factory
62
+
├── tools.ts # Tool registry
63
+
├── types/
64
+
│ ├── message.ts # Message types
65
+
│ └── permissions.ts # Permission types
66
+
├── tools/
67
+
│ ├── BashTool/
68
+
│ ├── FileReadTool/
69
+
│ ├── FileWriteTool/
70
+
│ ├── FileEditTool/
71
+
│ ├── GrepTool/
72
+
│ ├── GlobTool/
73
+
│ └── TodoWriteTool/
74
+
├── services/
75
+
│ ├── api/claude.ts # Anthropic SDK wrapper
76
+
│ └── compact/compact.ts # Context compression
77
+
├── screens/REPL.tsx # Terminal UI (Ink)
78
+
├── components/
79
+
│ ├── App.tsx
80
+
│ ├── MessageList.tsx
81
+
│ └── PermissionRequest.tsx
82
+
├── commands/
83
+
│ ├── clear.ts
84
+
│ ├── help.ts
85
+
│ └── compact.ts
86
+
└── utils/
87
+
├── permissions.ts
88
+
├── messages.ts
89
+
├── format.ts
90
+
└── config.ts
91
+
```
92
+
93
+
### What You Build Each Chapter
94
+
95
+
| Ch | Module Added | Demo Capability After |
96
+
|----|-------------|----------------------|
97
+
| 1 | Project scaffold + type system | Type definitions compile |
0 commit comments