Skip to content
Built 26/04/15 10:53commit de0ee65

中文 | English

claude-code-best-practice

从 vibe coding 走向 agentic engineering - practice makes claude perfect

= Agents · = Commands · = Skills

Claude Code mascot jumping
GitHub Trending #1 Repository Of The Day

Boris Cherny on Claude Code
Boris Cherny 在 X 上的帖子(tweet 1 · tweet 2 · tweet 3

🧠 CONCEPTS

FeatureLocationDescription
Subagents.claude/agents/<name>.md在全新隔离上下文中运行的自治执行体,拥有自定义工具、权限、模型、记忆和持久身份
Commands.claude/commands/<name>.md注入到现有上下文中的知识,即用户主动调用的简单 prompt 模板,用于工作流编排
Skills.claude/skills/<name>/SKILL.md注入到现有上下文中的知识,可配置、可预加载、可自动发现,并支持上下文 fork 与渐进式披露 · Official Skills
Workflows.claude/commands/weather-orchestrator.md
Hooks.claude/hooks/在 agentic loop 之外、针对特定事件运行的用户自定义处理器(scripts、HTTP、prompts、agents)· Guide
MCP Servers.claude/settings.json, .mcp.json连接外部工具、数据库和 API 的 Model Context Protocol
Pluginsdistributable packagesskills、subagents、hooks、MCP servers 与 LSP servers 的打包分发形式 · Marketplaces · Create Marketplaces
Settings.claude/settings.json分层配置系统 · Permissions · Model Config · Output Styles · Sandboxing · Keybindings · Fast Mode
Status Line.claude/settings.json可自定义状态栏,显示上下文使用量、模型、成本与会话信息
MemoryCLAUDE.md, .claude/rules/, ~/.claude/rules/, ~/.claude/projects/<project>/memory/通过 CLAUDE.md 文件和 @path 导入实现持久上下文 · Auto Memory · Rules
Checkpointingautomatic (git-based)基于 git 的自动编辑追踪,支持回退(Esc Esc/rewind)与定向摘要
CLI Startup Flagsclaude [flags]启动 Claude Code 的命令行 flags、subcommands 和环境变量 · Interactive Mode · Env Vars
AI TermsAgentic Engineering · Context Engineering · Vibe Coding
Best Practices官方最佳实践 · Prompt Engineering · Extend Claude Code

🔥 Hot

FeatureLocationDescription
Power-ups/powerup通过动画 demo 教学 Claude Code 功能的交互式课程(v2.1.90)
Ultraplan/ultraplan在云端起草计划,可在浏览器中审阅、行内评论并灵活执行,可远程运行,也可“传送”回终端
Claude Code Webclaude.ai/code在云基础设施上运行任务,适合长任务、PR 自动修复和无需本地搭建的并行会话 · Routines
Agent SDKnpm / pip package以 Claude Code 作为库来构建生产级 AI agent,提供 Python 与 TypeScript SDK,并内置 tools、hooks、subagents 和 MCP · Quickstart · Examples
No Flicker ModeCLAUDE_CODE_NO_FLICKER=1无闪烁 alt-screen 渲染,支持鼠标、稳定记忆和应用内滚动,属于可选研究预览
Computer Usecomputer-use MCP server让 Claude 控制你的屏幕,在 macOS 上打开应用、点击、输入并截图 · Desktop
Auto Modeclaude --enable-auto-mode后台安全分类器替代手动权限提示,Claude 自行判断什么是安全的,同时拦截 prompt injection 和高风险升级;可用 claude --enable-auto-mode(或 --permission-mode auto)启动,也可在会话中用 Shift+Tab 切换 · Blog
Channels--channels, plugin-based把 Telegram、Discord 或 webhook 事件推入运行中的会话,让 Claude 在你离开时也能响应 · Reference
Slack@Claude in Slack在团队聊天中 @Claude 提交编码任务,会被路由到 Claude Code web 会话执行 bug 修复、code review 和并行任务
Code ReviewGitHub App (managed)多 agent PR 分析,可在合并前捕捉 bug、安全问题和回归 · Blog
GitHub Actions.github/workflows/在 CI/CD 里自动化 PR 审查、issue 分流和代码生成 · GitLab CI/CD
Chrome--chrome, extension通过 Claude in Chrome 做浏览器自动化,可测试 web app、读取 console 调试、自动填表和抓取页面数据
Scheduled Tasks/loop, /schedule, cron tools/loop 在本地按周期运行 prompt(最长 7 天);/schedule 在 Anthropic 云基础设施上运行 prompt,即便机器关机也能继续 · Announcement
Routinesclaude.ai/code/routines, /schedule运行在 Anthropic 基础设施上的云自动化,可按计划、API 触发或 GitHub 事件驱动,即便机器关闭也能运行 · Desktop Tasks
Devcontainers.devcontainer/带安全隔离和防火墙规则的预配置开发容器,用于提供一致的 Claude Code 运行环境
Voice Dictation/voice按住说话输入 prompt,支持 20 种语言和可重绑定激活键
Simplify & Batch/simplify, /batch内置 skills,用于代码质量和批量操作;simplify 负责重构复用与效率,batch 负责跨文件批跑命令
Agent Teamsbuilt-in (env var)多个 agent 在同一代码库上并行协作,并共享任务协调机制
Remote Control/remote-control, /rc从任何设备继续本地会话,包括手机、平板和浏览器 · Headless Mode
Git Worktreesbuilt-in用隔离 git 分支支持并行开发,让每个 agent 拥有自己的工作副本
Ralph Wiggum Loopplugin面向长任务的自主开发循环,会持续迭代直到完成

section divider

参见 orchestration-workflow 了解 CommandAgentSkill 模式的实现细节。

Command Skill Agent Architecture Flow

Orchestration Workflow Demo

text
claude
/weather-orchestrator

section divider

⚙️ DEVELOPMENT WORKFLOWS

所有主要工作流最终都收敛到同一个架构模式:Research → Plan → Execute → Review → Ship

NameUniquenessPlan
Everything Claude Code156kplanner48143230
Superpowers152kwriting-plans5314
Spec Kit88kspeckit.plan09+0
gstack72kautoplan0036
Get Shit Done53kgsd-planner311220
BMAD-METHOD45kbmad-create-prd0037
OpenSpec40kopsx:propose0100
oh-my-claudecode29kralplan19037
Compound Engineering14kce-plan49442
HumanLayer10kcreate_plan6270

Others

section divider

💡 TIPS AND TRICKS (69)

🚫👶 = 不要 babysit

Prompting · Planning · CLAUDE.md · Agents · Commands · Skills · Hooks · Workflows · Advanced · Git / PR · Debugging · Utilities · Daily

Prompting (3)

TipSource
挑战 Claude:“狠狠质询我这次改动,在我通过你的测试前不要发 PR。”或者“向我证明这真的能工作”,并让 Claude 比较 main 和你的分支的 diff 🚫👶
修了个平庸的方案之后,可以说:“基于你现在知道的一切,把这个废掉,重新实现那个优雅的方案。” 🚫👶
Claude 大多数 bug 都能自己修,把 bug 贴给它,说一句“fix”,不要 micromanage 它怎么做 🚫👶

Planning/Specs (6)

TipSource
总是先用 plan mode 开始
从一个最小 spec 或 prompt 开始,让 Claude 用 AskUserQuestion 工具反向采访你,然后开一个新会话去执行这个 spec
总是先做按阶段 gated 的计划,每个阶段都配多个测试(unit、automation、integration)
启动第二个 Claude 以 staff engineer 身份审查你的计划,或者用 cross-model 做审查
在交接工作前写清详细 specs、减少歧义;你越具体,输出越好
prototype > PRD,与其写 specs 不如先做 20-30 个版本;构建成本很低,所以要多打几枪

CLAUDE.md (7)

TipSource
CLAUDE.md 每个文件最好控制在 200 行以内humanlayer 用 60 行,但依然不是 100% 保证
<important if="..."> tags 包住领域专属的 CLAUDE.md 规则,防止文件一长 Claude 就忽略它们
monorepo 用 多个 CLAUDE.md —— 祖先目录 + 子目录联动加载
.claude/rules/ 拆分过大的指令
memory.md 才是关键,constitution.md 不保证任何事情
任意开发者都应该能启动 Claude,说一句“run the tests”就第一次成功;如果做不到,说明你的 CLAUDE.md 缺了必要的 setup/build/test 命令
保持代码库整洁并及时完成迁移;迁了一半的框架会让模型误选错误模式
settings.json 做 harness 级强约束行为(署名、权限、模型);不要把“NEVER add Co-Authored-By”写进 CLAUDE.md,因为 attribution.commit: "" 更确定

Agents (4)

TipSource
用面向具体 feature 的 sub-agents(额外上下文)配 skills(渐进式披露),而不是泛化的 QA、backend engineer
直接说“use subagents”来给问题砸更多算力,把任务卸载出去,保持主上下文干净聚焦 🚫👶
agent teams with tmuxgit worktrees 做并行开发
test time compute —— 分离上下文窗口会让结果更好;一个 agent 可能引入 bug,另一个(同模型)能把它找出来

Commands (3)

TipSource
commands 来承载你的工作流,而不是 sub-agents
对每天都要反复做的“inner loop”工作流,全部做成 slash commands;这能省掉重复提示词,commands 放在 .claude/commands/ 里并随 git 管理
一件事如果你一天会做不止一次,就把它变成 skillcommand —— 比如 /techdebt、context-dump 或 analytics commands

Skills (9)

TipSource
context: fork 在隔离 subagent 中运行 skill,主上下文只看到最终结果,不看到中间 tool calls;agent 字段可指定 subagent 类型
monorepo 用 skills in subfolders
skill 是文件夹,不是单文件;请使用 references/scripts/examples/ 等子目录做 progressive disclosure
每个 skill 都要有 Gotchas 小节,这是最高信号密度的内容,用来累计 Claude 的失败模式
skill 的 description 字段是触发器,不是摘要,写给模型看,回答“什么时候该触发我?”
skill 里不要写显而易见的话,要专注于把 Claude 从默认行为里推出来的东西 🚫👶
不要在 skill 里把 Claude 轨道化到死,给它目标和约束,不要给死板步骤 🚫👶
在 skill 里包含 scripts 和 libraries,让 Claude 去组合,而不是重建样板代码
SKILL.md 中嵌入 !`command`,把动态 shell 输出注入 prompt;Claude 会在调用时执行它,而模型只看到结果

Hooks (5)

TipSource
在 skills 里用 on-demand hooks/careful 阻止危险命令,/freeze 阻止越界编辑
用 PreToolUse hook measure skill usage,找出哪些 skills 热门或触发不足
PostToolUse hook 自动格式化代码;Claude 负责产出好代码,hook 补最后 10%,避免 CI 失败
permission requests 路由给 Opus 处理,让它扫描攻击并自动批准安全请求 🚫👶
Stop hook 在回合末推动 Claude 继续做完或验证自己的工作

Workflows (7)

TipSource
避开 agent dumb zone,在 50% 上下文前手动做 /compact;如果中途切换新任务,用 /clear 重置上下文
对更小的任务,原生 vanilla cc 比各种工作流都更好
/model 选模型和 reasoning,用 /context 看上下文使用量,用 /usage 查 plan 限额,用 /extra-usage 配 overflow billing,用 /config 管理设置;plan mode 用 Opus,写代码用 Sonnet,二者结合最好
始终开启 thinking mode true(便于看到推理),并在 /config 里使用 Output Style 的 Explanatory(展示详细输出和 ★ Insight 框)以更好理解 Claude 的决策
在 prompts 中使用 ultrathink 关键词触发 high effort reasoning
/rename 给重要会话命名(如 [TODO - refactor task]),并通过 /resume 之后恢复;同时运行多个 Claude 时,每个实例都要有标签
Claude 走偏时,用 Esc Esc 或 /rewind 回退,而不是尝试在同一上下文里硬修

Workflows Advanced (6)

TipSource
大量使用 ASCII 图来理解你的架构
/loop 做本地周期监控(最长 3 天);用 /schedule 做云端周期任务,即便机器关闭也会运行
Ralph Wiggum plugin 承接长时间自治任务
用带通配符语法的 /permissions(如 Bash(npm run *), Edit(/docs/**)),不要用 dangerously-skip-permissions
/sandbox 通过文件和网络隔离减少权限提示,内部统计可降低 84%
值得花一周时间打磨 product verification skills(如 signup-flow-drivercheckout-verifier

Git / PR (5)

TipSource
保持 PR 小而聚焦 —— p50 为 118 行(一天 141 个 PR、45K 行变更),一项功能一个 PR,更容易 review 和回滚
始终 squash merge PR,保持线性整洁历史,一个功能一个提交,方便 git revertgit bisect
经常提交,最好至少每小时一次,任务一完成就 commit
在同事 PR 上 @@claude,让它为重复 review 反馈自动生成 lint 规则,把自己从 code review 里自动化掉 🚫👶
/code-review 做多 agent PR 分析,在合并前抓出 bug、安全问题和回归

Debugging (7)

TipSource
养成习惯:一旦卡住,就截图给 Claude 看
用 mcp(Claude in ChromePlaywrightChrome DevTools)让 Claude 自己看到 Chrome console 日志
调试时总是让 Claude 把你想看的终端作为后台任务运行起来,这样更容易排查
/doctor 诊断安装、认证和配置问题
compact 时出错,可以先用 /model 切到 1M token 模型,再执行 /compact
cross-model 做 QA,比如用 Codex 来审查计划和实现
agentic search(glob + grep)优于 RAG;Claude Code 曾尝试过向量数据库又放弃了,因为代码会漂移失同步,而且权限太复杂

Utilities (5)

TipSource
优先使用 iTerm / Ghostty / tmux 这类终端,而不是 IDE(VS Code / Cursor
/voiceWispr Flow 做语音提示(10 倍生产力)
claude-code-hooks 处理 Claude 反馈
status line 提升上下文感知和快速 compact
深挖 settings.json 的特性,例如 Plans DirectorySpinner Verbs,打造个性化体验

Daily (2)

TipSource
每天都要 update Claude Code
每天开始工作前先读 changelog
Article / TweetSource
15 Hidden & Under-Utilized Features in Claude Code (Boris) | 30/Mar/26Tweet
Squash Merging & PR Size Distribution (Boris) | 25/Mar/26Tweet
Lessons from Building Claude Code: How We Use Skills (Thariq) | 17/Mar/26Article
Code Review & Test Time Compute (Boris) | 10/Mar/26Tweet
/loop — 安排最长 3 天的周期任务(Boris)| 07 Mar 2026Tweet
AskUserQuestion + ASCII Markdowns(Thariq)| 28 Feb 2026Tweet
Seeing like an Agent - lessons from building Claude Code(Thariq)| 28 Feb 2026Article
Git Worktrees - 5 ways how boris is using | 21 Feb 2026Tweet
Lessons from Building Claude Code: Prompt Caching Is Everything(Thariq)| 20 Feb 2026Article
12 ways how people are customizing their claudes (Boris) | 12/Feb/26Tweet
10 tips for using Claude Code from the team (Boris) | 01/Feb/26Tweet
How I use Claude Code — 13 tips from my surprisingly vanilla setup (Boris) | 03/Jan/26Tweet
Ask Claude to interview you using AskUserQuestion tool(Thariq)| 28/Dec/25Tweet
Always use plan mode, give Claude a way to verify, use /code-review(Boris)| 27/Dec/25Tweet

section divider

🎬 VIDEOS / PODCASTS

Video / PodcastSourceYouTube
Everything We Got Wrong About Research-Plan-Implement (Dex) | 24 Mar 2026 | MLOps CommunityYouTube
Building Claude Code with Boris Cherny (Boris) | 04 Mar 2026 | The Pragmatic EngineerYouTube
Head of Claude Code: What happens after coding is solved (Boris) | 19 Feb 2026 | Lenny's PodcastYouTube
Inside Claude Code With Its Creator Boris Cherny (Boris) | 17 Feb 2026 | Y CombinatorYouTube
Boris Cherny (Creator of Claude Code) On What Grew His Career (Boris) | 15 Dec 2025 | Ryan PetermanYouTube
The Secrets of Claude Code From the Engineers Who Built It (Cat) | 29 Oct 2025 | EveryYouTube

section divider

🔔 SUBSCRIBE

SourceNameBadge
r/ClaudeAI, r/ClaudeCode, r/Anthropic
Claude, Anthropic, Boris, Thariq, Cat, Lydia, Noah, Anthony, Alex, Kenneth
Jesse Kriss (Superpowers), Affaan Mustafa (ECC), Garry Tan (gstack), Dex Horthy (HumanLayer), Kieran Klaassen (Compound Eng), Tabish Gilani (OpenSpec), Brian McAdams (BMAD), Lex Christopherson (GSD), Dani Avila (CC Templates), Dan Shipper (Every), Andrej Karpathy (AutoResearch), Peter Steinberger (OpenClaw), Sigrid Jin (claw-code), Yeachan Heo (oh-my-claudecode)
Anthropic
Lenny's Podcast, Y Combinator, The Pragmatic Engineer, Ryan Peterman, Every, MLOps Community

section divider

☠️ STARTUPS / BUSINESSES

ClaudeReplaced
Code ReviewGreptile, CodeRabbit, Devin Review, OpenDiff, Cursor BugBot
Voice DictationWispr Flow, SuperWhisper
Remote ControlOpenClaw
Claude in ChromePlaywright MCP, Chrome DevTools MCP
Computer UseOpenAI CUA
CoworkChatGPT Agent, Perplexity Computer, Manus
TasksBeads
Plan ModeAgent OS
Skills / PluginsYC AI wrapper startups(reddit

section divider

Billion-Dollar Questions

如果你有答案,请通过 shanraisshan@gmail.com 告诉我

Memory & Instructions (4)

  1. 你的 CLAUDE.md 里究竟该放什么,不该放什么?
  2. 如果你已经有了 CLAUDE.md,还需要单独的 constitution.mdrules.md 吗?
  3. 你应该多久更新一次 CLAUDE.md?又该如何判断它已经 stale?
  4. 为什么 Claude 还是会忽略 CLAUDE.md 里的指令,即使里面用全大写写了 MUST?(reddit

Agents, Skills & Workflows (6)

  1. 什么时候该用 command,什么时候该用 agent,什么时候该用 skill?以及什么时候原生 Claude Code 反而更好?
  2. 随着模型进步,你应该多频繁更新 agents、commands 和 workflows?
  3. 给 subagent 一个详细 persona 会提升质量吗?研究型 / QA 型 subagent 的“完美 persona/prompt”长什么样?
  4. 你应该依赖 Claude Code 内置的 plan mode,还是自己构建一个强制团队流程的 planning command/agent?
  5. 如果你有个人 skill(例如带你编码风格的 /implement),又想引入社区 skill(例如 /simplify),该如何避免冲突?意见不一致时该听谁的?
  6. 我们到那一步了吗?能不能把现有代码库转成 specs、删掉代码,再只靠 specs 让 AI 重新生成完全一样的代码?

Specs & Documentation (3)

  1. 你的仓库里每个 feature 都应该有一个 markdown spec 吗?
  2. 新 feature 实现之后,你需要多频繁更新 specs,才能不让它们过时?
  3. 实现一个新 feature 时,如何处理它对其他 feature specs 产生的连锁影响?

section divider

REPORTS

section divider

text
1. 像读课程一样读这个仓库,先理解 commands、agents、skills 和 hooks 是什么,再尝试真正使用它们。
2. clone 这个仓库并玩一遍示例,试试 /weather-orchestrator,听听 hook 音效,跑一下 agent teams,这样你才能看到它们究竟怎么工作。
3. 回到你自己的项目里,让 Claude 建议你应该从这个仓库吸收哪些 best practices,并把这个仓库作为参考给它,让它知道哪些事情是可能的。

Watch on YouTube

section divider

GitHub Trending
✨2026 年 3 月 GitHub Trending✨

Other Repos

claude-code-hooks · Codex CLI codex-cli-best-practice · Codex CLI Hooks codex-cli-hooks

Developed by

#WorkflowDescription
1/workflows:development-workflows通过并行研究全部 10 个 workflow 仓库,更新 DEVELOPMENT WORKFLOWS 表和跨工作流分析报告
2/workflows:best-practice:workflow-concepts用最新 Claude Code 功能与概念更新 README 的 CONCEPTS 小节
3/workflows:best-practice:workflow-claude-settings跟踪 Claude Code settings 报告的变化并找出需要更新的地方
4/workflows:best-practice:workflow-claude-subagents跟踪 Claude Code subagents 报告的变化并找出需要更新的地方
5/workflows:best-practice:workflow-claude-commands跟踪 Claude Code commands 报告的变化并找出需要更新的地方
6/workflows:best-practice:workflow-claude-skills跟踪 Claude Code skills 报告的变化并找出需要更新的地方

Star History

Star History Chart

stars and counting

section divider

如果你喜欢我的工作,可以请我喝一杯 doodh patti 🍵:

Polar Polar