shanraisshan/claude-code-best-practice
GitHub: shanraisshan/claude-code-best-practice
Claude Code 的全面最佳实践指南,涵盖 Commands、Agents、Skills、MCP 等核心功能的配置与编排模式。
Stars: 14051 | Forks: 1322
# claude-code-best-practice
practice makes claude perfect

[](best-practice/) *点击此徽章查看最新最佳实践*
[](implementation/) *点击此徽章查看本仓库中的实现*
[](orchestration-workflow/orchestration-workflow.md) *点击此徽章查看 Command → Agent → Skill 编排工作流*.md` | [](best-practice/claude-commands.md) [](implementation/claude-commands-implementation.md) 注入到现有上下文中的知识 — 用于工作流编排的简单用户调用提示模板 |
| [**Sub-Agents**](https://code.claude.com/docs/en/sub-agents) | `.claude/agents/.md` | [](best-practice/claude-subagents.md) [](implementation/claude-subagents-implementation.md) 在全新隔离上下文中运行的自主执行者 — 拥有自定义工具、权限、模型、记忆和持久身份 |
| [**Skills**](https://code.claude.com/docs/en/skills) | `.claude/skills//SKILL.md` | [](best-practice/claude-skills.md) [](implementation/claude-skills-implementation.md) 注入到现有上下文中的知识 — 可配置、可预加载、可自动发现,支持上下文分叉和渐进式披露 · [官方 Skills](https://github.com/anthropics/skills/tree/main/skills) |
| [**Workflows**](https://code.claude.com/docs/en/common-workflows) | [`.claude/commands/weather-orchestrator.md`](.claude/commands/weather-orchestrator.md) | [](orchestration-workflow/orchestration-workflow.md) |
| [**Hooks**](https://code.claude.com/docs/en/hooks) | `.claude/hooks/` | [](https://github.com/shanraisshan/claude-code-voice-hooks) [](https://github.com/shanraisshan/claude-code-voice-hooks) 在特定事件时于智能体循环之外运行的确定性脚本 |
| [**MCP Servers**](https://code.claude.com/docs/en/mcp) | `.claude/settings.json`, `.mcp.json` | [](best-practice/claude-mcp.md) [](.mcp.json) 连接外部工具、数据库和 API 的 Model Context Protocol 连接 |
| [**Plugins**](https://code.claude.com/docs/en/plugins) | 可分发包 | Skills、Subagents、Hooks 和 MCP Servers 的捆绑包 · [市场](https://code.claude.com/docs/en/discover-plugins) |
| [**Settings**](https://code.claude.com/docs/en/settings) | `.claude/settings.json` | [](best-practice/claude-settings.md) [](.claude/settings.json) 分层配置系统 · [权限](https://code.claude.com/docs/en/permissions) · [模型配置](https://code.claude.com/docs/en/model-config) · [输出样式](https://code.claude.com/docs/en/output-styles) · [沙箱](https://code.claude.com/docs/en/sandboxing) · [快捷键](https://code.claude.com/docs/en/keybindings) · [快速模式](https://code.claude.com/docs/en/fast-mode) |
| [**Status Line**](https://code.claude.com/docs/en/statusline) | `.claude/settings.json` | [](https://github.com/shanraisshan/claude-code-status-line) [](.claude/settings.json) 显示上下文使用量、模型、成本和会话信息的可自定义状态栏 |
| [**Memory**](https://code.claude.com/docs/en/memory) | `CLAUDE.md`, `.claude/rules/`, `~/.claude/rules/`, `~/.claude/projects//memory/` | [](best-practice/claude-memory.md) [](CLAUDE.md) 通过 CLAUDE.md 文件和 `@path` 导入实现持久化上下文 · [自动记忆](https://code.claude.com/docs/en/memory) · [规则](https://code.claude.com/docs/en/memory#organize-rules-with-clauderules) |
| [**Checkpointing**](https://code.claude.com/docs/en/checkpointing) | 自动(基于 git) | 自动跟踪文件编辑,支持回退(`Esc Esc` 或 `/rewind`)和针对性摘要 |
| [**CLI Startup Flags**](https://code.claude.com/docs/en/cli-reference) | `claude [flags]` | [](best-practice/claude-cli-startup-flags.md) 用于启动 Claude Code 的命令行标志、子命令和环境变量 · [交互模式](https://code.claude.com/docs/en/interactive-mode) |
| **AI 术语** | | [](https://github.com/shanraisshan/claude-code-codex-cursor-gemini/blob/main/reports/ai-terms.md) Agentic Engineering · Context Engineering · Vibe Coding |
| [**最佳实践**](https://code.claude.com/docs/en/best-practices) | | 官方最佳实践 · [提示工程](https://github.com/anthropics/prompt-eng-interactive-tutorial) · [扩展 Claude Code](https://code.claude.com/docs/en/features-overview) |
### 🔥 热门
| 功能 | 位置 | 描述 |
|---------|----------|-------------|
| [**/btw**](https://x.com/trq212/status/2031506296697131352) | `/btw` | [](https://x.com/trq212/status/2031506296697131352) Claude 工作时的侧链对话 |
| [**Code Review**](https://code.claude.com/docs/en/code-review)  | GitHub App(托管) | [](https://x.com/claudeai/status/2031088171262554195) 多智能体 PR 分析,可发现 bug、安全漏洞和回归问题 · [博客](https://claude.com/blog/code-review) |
| [**Scheduled Tasks**](https://code.claude.com/docs/en/scheduled-tasks) | `/loop`, cron 工具 | [](https://x.com/bcherny/status/2030193932404150413) [](implementation/claude-scheduled-tasks-implementation.md) 按循环计划运行提示(最长 3 天),设置一次性提醒,轮询部署和构建 |
| [**Voice Mode**](https://x.com/trq212/status/2028628570692890800)  | `/voice` | [](https://x.com/trq212/status/2028628570692890800) 语音转提示 — /voice 激活 |
| [**Simplify & Batch**](https://x.com/bcherny/status/2027534984534544489) | `/simplify`, `/batch` | [](https://x.com/bcherny/status/2027534984534544489) 用于代码质量和批量操作的内置 Skills — simplify 重构以提升复用性和效率,batch 跨文件运行命令 |
| [**Agent Teams**](https://code.claude.com/docs/en/agent-teams)  | 内置(环境变量) | [](https://x.com/bcherny/status/2019472394696683904) [](implementation/claude-agent-teams-implementation.md) 多个智能体在同一代码库中并行工作,具有共享任务协调 |
| [**Remote Control**](https://code.claude.com/docs/en/remote-control) | `/remote-control`, `/rc` | 从任意设备(手机、平板或浏览器)继续本地会话 · [无头模式](https://code.claude.com/docs/en/headless) |
| [**Git Worktrees**](https://code.claude.com/docs/en/common-workflows) | 内置 | [](https://x.com/bcherny/status/2025007393290272904) 用于并行开发的隔离 git 分支 — 每个智能体获得自己的工作副本 |
| [**Ralph Wiggum Loop**](https://github.com/anthropics/claude-code/tree/main/plugins/ralph-wiggum) | 插件 | [](https://github.com/ghuntley/how-to-ralph-wiggum) [](https://github.com/shanraisshan/novel-llm-26) 用于长时间运行任务的自主开发循环 — 持续迭代直至完成 |
##
查看 [orchestration-workflow](orchestration-workflow/orchestration-workflow.md) 了解 **Command → Agent → Skill** 模式的实现详情。
[](implementation/) *点击此徽章查看本仓库中的实现*
[](orchestration-workflow/orchestration-workflow.md) *点击此徽章查看 Command → Agent → Skill 编排工作流*

Boris Cherny on X (tweet 1 · tweet 2 · tweet 3)
标签:AI 编程, Anthropic, CIS基准, Claude Code, DLL 劫持, LLM, MITM代理, Slash Commands, SOC Prime, Sub-Agents, Unmanaged PE, 人工智能, 代码助手, 后端开发, 大语言模型, 子代理, 工作流编排, 开发工具, 效率提升, 斜杠命令, 最佳实践, 用户模式Hook绕过, 知识管理, 网络调试, 自动化, 软件开发, 防御加固