GitHub: https://github.com/anthropics/claude-code-best-practices
Stars: 47k+ ⭐(GitHub趋势显示持续增长中)
更新:实时追踪最新进展
技术:Markdown + HTML + 交互式文档
一句话介绍
从Vibe Coding到Agentic Engineering的实战指南 — Anthropic团队最新开源的Claude Code最佳实践库,汇聚了Claude Code创建者Boris Cherny的第一手经验结晶,包含80+条实战Tips、12大核心概念体系、完整工作流示例,帮你把"随便写写"进化到"工程化智能编程"。
为什么值得关注
1. 官方团队直接出品,第一手经验
这是Anthropic团队(Claude Code的创造者)官方出品的Best Practice仓库。内容直接来自:
- • Boris Cherny(Claude Code创建者)的推特、博客和访谈
每个Tips都标注了精确来源,包括Boris的多个系列文章:13 Tips、10 Tips、12 Tips、15 Tips等系列。
2. 完整的概念体系升级
相比之前的版本,这个仓库系统梳理并更新了Claude Code的全部核心概念:
| | | |
|---|
| Subagents | .claude/agents/.md | | |
| Commands | .claude/commands/.md | | |
| Skills | .claude/skills//SKILL.md | | |
| Hooks | .claude/hooks/ | | |
| MCP Servers | .mcp.json | | |
| Memory | CLAUDE.md | | |
3. 80+条实战Tips升级
仓库整理了来自Boris和社区的最新80+条实战技巧,涵盖:
Prompting(5条新技巧)
- • "grill me on these changes" — 让Claude挑战你的代码,测试通过再PR
- • "knowing everything you know now, scrap this and implement the elegant solution" — 遇到平庸方案时重新设计
- • "prove to me this works with tests" — 要求Claude提供测试证明
- • "show me the edge cases" — 主动寻找边界情况
- • "what would go wrong here?" — 预测潜在问题
CLAUDE.md(10条新技巧)
- • 任何开发者打开项目说"run the tests"就能成功 — 否则CLAUDE.md缺少关键命令
Agents(6条新技巧)
- • 用feature-specific subagents + skills替代通用的"qa"、"backend engineer"
- • "use subagents"扔更多算力解决问题,保持主上下文干净
Skills(12条新技巧)
- • 用
context: fork在隔离subagent中运行skill - • skill的description是触发器,不是摘要 — 写给模型看("when should I fire?")
- • 不要在skill里railroad Claude — 给目标和约束,不要逐步指令
4. 12大开发工作流深度对比
仓库对比了12个主流Claude Code工作流,新增了最新方案:
| | | |
|---|
| Everything Claude Code | | 47 Agents + 82 Commands + 182 Skills | |
| Superpowers | | TDD-first + Iron Laws + whole-plan review | |
| Spec Kit | | spec-driven + constitution + 22+ tools |
|
| gstack | | role personas + /codex review + parallel sprints | |
| Get Shit Done | | fresh 200K contexts + wave execution + XML plans | |
| BMAD-METHOD | | full SDLC + agent personas + 22+ platforms | |
| OpenSpec | | delta specs + brownfield + artifact DAG | |
| oh-my-claudecode | | teams orchestration + tmux workers + skill auto-inject | |
| Compound Engineering | | Compound Learning + Multi-Platform CLI + Plugin Marketplace | |
| HumanLayer | | RPI + context engineering + 300k+ LOC | |
| Agent Teams v2 | | | |
| Ultraplan Pro | | | |
所有工作流都遵循同一架构:Research → Plan → Execute → Review → Ship
5. 最新功能追踪(持续更新)
仓库实时追踪Claude Code的最新功能:
| | | |
|---|
| Power-ups |
/powerup | | |
| Ultraplan | /ultraplan | | |
| Auto Mode | --enable-auto-mode | | |
| Agent Teams | | | |
| Remote Control | /remote-control | | |
| Scheduled Tasks | /loop | | |
| Voice Dictation | /voice | | |
| Code Review Assistant | /review | | |
| Performance Analyzer | /perf | | |
| Security Scanner | /security | | |
Orchestration Workflow 深度示例
仓库提供了一个完整的现代化工作流示例:
Command → Agent → Skill 协作模式升级版
- 1. Command 作为入口,定义工作流触发条件
- 2. Agent 执行具体任务,在隔离上下文中工作
- 3. Skill 提供专业知识,渐进披露给 Agent
claude
/weather-orchestrator-v2
这个示例展示了如何让Claude自动查询天气、生成报告、发送通知的完整现代化流程,集成了最新的Agent Teams功能。
Boris Cherny 的核心观点更新
关于 Vibe Coding vs Agentic Engineering
"Claude fixes most bugs by itself — paste the bug, say 'fix', don't micromanage how"
Boris的最新强调:
- • 不要babysit Claude,给目标让它自己解决
- • prototype > PRD — 成本低就多做尝试,写20-30个版本比写规格文档更有价值
关于 PR 和 Git 最佳实践
- • PR保持小而聚焦 — Boris一天141个PR,p50只有118行
- • 始终squash merge — 清晰的线性历史,方便revert和bisect
关于调试和测试
- • 用MCP(Claude in Chrome、Playwright)让Claude自己看控制台日志
- • agentic search(glob + grep)打败RAG — 代码会drift,权限复杂
快速开始指南
1. 克隆仓库学习
git clone https://github.com/anthropics/claude-code-best-practices
cd claude-code-best-practices
仓库建议的阅读顺序:
- 2. 克隆仓库玩示例(
/weather-orchestrator-v2、hook sounds、agent teams) - 3. 在自己的项目里让Claude建议应该采用哪些最佳实践
2. 核心配置文件(新版)
项目根目录/
├── CLAUDE.md # 项目级指令(<200 行)
├── .claude/
│ ├── settings.json # 权限、模型、输出风格配置
│ ├── agents/ # Subagents 定义
│ ├── commands/ # Slash commands
│ ├── skills/ # Skills 目录
│ ├── hooks/ # Hooks 定义
│ ├── rules/ # 规则文件(可拆分大指令)
│ └── teams/ # Agent Teams 配置(新增)
├── .mcp.json # MCP Servers 配置
└── .claudeignore # 文件忽略配置(新增)
3. 常用命令速查(最新版)
| | |
|---|
/model | | |
/context | | |
/usage | | |
/compact | | |
/clear | | |
/rewind | | |
/doctor | | |
/rename | | |
/team | |
|
/review | | |
/perf | | |
/security | | |
适用场景扩展
- • AI Agent开发者 — 学习Subagents、Skills、Hooks、Agent Teams的正确用法
- • 团队工程化 — 建立统一的Commands、工作流、Code Review自动化
- • Claude Code新手 — 从80+条Tips快速入门
- • 高级用户 — 学习Agent Teams、Git Worktrees、Scheduled Tasks
- • 产品验证 — 投资signup-flow-driver、checkout-verifier等skill
常见问题解答
CLAUDE.md被Claude忽略怎么办?
什么时候用Command vs Agent vs Skill vs Hook?
- • 小任务直接vanilla Claude Code,别过度设计
如何避免babysitting?
- • 用"prove to me this works"让Claude自证
- • 让另一个Claude或cross-model做review
Agent Teams如何工作?
总结
这个仓库是Claude Code生态的"百科全书"升级版:
- 1. 概念完整
— Subagents、Commands、Skills、Hooks、MCP、Memory、Agent Teams全覆盖
- 2. 实战丰富 — 80+条来自创建者和社区的Tips
如果你在使用Claude Code,这个仓库值得每天刷一遍。从vibe coding到agentic engineering,practice makes Claude perfect。
项目地址:https://github.com/anthropics/claude-code-best-practices
协议:MIT License
作者:Anthropic Team & Community
最后更新:实时更新中