MiniClaudeCode — Development skill for Claude Code
miniClaudeCode - 从50万行蒸馏到~1000行的Claude Code核心Agent架构最小复现 Distilled Claude Code agent framework.
How to install MiniClaudeCode
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open bcefghj/miniClaudeCode and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What MiniClaudeCode does
miniClaudeCode - 从50万行蒸馏到~1000行的Claude Code核心Agent架构最小复现 Distilled Claude Code agent framework.
Alternatives in Development
- Native Feel Skill — An Agent Skill for designing cross-platform desktop apps that feel native — distilled from Raycast's 2.0 deep 1.9k ★
- Lab Skills — Skills distilled from the Lab's real work and collaboration practices 309 ★
- Tufte Claude Skill — Claude Code skill that turns 'make me a chart' into a Tufte-compliant chart 295 ★
README
miniClaudeCode
**从 50 万行蒸馏到 ~800 行 -- Claude Code 核心架构的最小可运行复现**
miniClaudeCode 是对 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 核心 Agent 架构的蒸馏(distillation)实现。它保留了 Claude Code 最核心的四大模块——Agent Loop、Tool System、Permission System、Context Management——同时将代码量从原版的 ~500K 行精简到 ~800 行纯 Python。
架构总览
用户输入
│
▼
┌─────────────────────────────────┐
│ Agent Loop │
│ ┌───────────────────────────┐ │
│ │ 1. 构建 System Prompt │ │
│ │ 2. 调用 Claude API │ │
│ │ 3. 解析 tool_use blocks │ │
│ │ 4. 权限检查 (2层) │ │
│ │ 5. 执行工具 │ │
│ │ 6. 结果追加到上下文 │ │
│ │ 7. 循环直到无工具调用 │ │
│ └───────────────────────────┘ │
└─────────────────────────────────┘
│
▼
最终文本输出
Claude Code 原版 vs miniClaudeCode
| 模块 | Claude Code 原版 | miniClaudeCode |
|---|---|---|
| Agent Loop | SSE 流式 + 多并行 tool_use | 同步循环 + 顺序工具链 |
| 工具数量 | 26+ 内置工具 + MCP 扩展 | 6 个核心工具 |
| 权限系统 | 5 层 (工具自检 / allowlist / sandbox / 模式 / hooks) | 2 层 (工具自检 + 模式) |
| 上下文管理 | 会话持久化 + 压缩 + CLAUDE.md + 记忆 | 消息列表 + 截断 + CLAUDE.md |
| 终端 UI | React/Ink 渲染 | 简单 REPL |
| 代码量 | ~500,000 行 TypeScript | ~800 行 Python |
快速开始
安装
cd miniClaudeCode
pip install -r requirements.txt
设置 API Key
export ANTHROPIC_API_KEY="your-api-key"
交互模式
python -m miniclaudecode
单次执行
python -m miniclaudecode "帮我查看当前目录下有哪些 Python 文件"
指定模式
# 自动模式 (无需确认)
python -m miniclaudecode --mode auto "列出所有 .py 文件"
# 只读模式 (禁止写操作)
python -m miniclaudecode --mode plan "分析项目结构"
内置工具
miniClaudeCode 保留了 Claude Code 最核心的 6 个工具:
| 工具 | 对应原版 | 功能 |
|---|---|---|
bash |
BashTool | 执行 shell 命令 |
read_file |
FileReadTool | 读取文件内容(带行号) |
write_file |
FileWriteTool | 写入文件 |
edit_file |
FileEditTool | 字符串替换编辑 |
glob |
GlobTool | 按模式搜索文件 |
grep |
GrepTool | 正则搜索文件内容 |
蒸馏笔记
什么是"蒸馏"?
蒸馏 (Distill
Related Skills
Miniclaudecode TypeScript
Claude Code 50万行源码蒸馏为12阶段TypeScript教学框架 — 从循环到多Agent团队,附哆啦A梦漫画
LocoOperator
Local 4B codebase explorer agent distilled from Qwen3-Coder-Next.
Bookforge Skills
Agent skills distilled from non-fiction books. Works with Claude Code, Codex, Gemini CLI, Cursor, Copilot, and
Broadcast
Run broadcast on a distilled Raw — update related existing pages conversationally
Anthropic Mind
Anthropic Mind — a Claude Agent Skill distilled from 428 primary Anthropic sources, shipped with the full corp
Gas Best Practices
Google Apps Script best practices distilled from production bugs — Claude Code skill for GAS web apps, clasp p
Related Agents
Recall
Runs the recall CLI over the user's past Claude Code sessions and returns the one actionable item — a command,
Ferrox AI Researcher
Researches a chosen AI framework's official docs to produce implementation-ready guidance — best practices, sy
Bash Expert
Use this agent to RUN long or output-heavy command-line work and return distilled results, and to write or ref