claude-code-best-practice

shanraisshanMIT活跃维护

把 Claude Code 从随手写代码的「氛围编程」升级为可控的智能体工程实践,汇总提示词、工作流和最佳实践,让 AI 编码代理更稳定可靠。

from vibe coding to agentic engineering - practice makes claude perfect

暂无版本68,935star +192 / 7 天6,862fork同步于 2026-11-10 17:18 UTC

怎么上手

由 README 提炼,执行前请确认
README 未说明
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Claude Code 最佳实践与实现示例合集,帮你从随手写代码进阶到智能体工程

把 Claude Code 从随手写代码的「氛围编程」升级为可控的智能体工程实践,汇总提示词、工作流和最佳实践,让 AI 编码代理更稳定可靠。

核心能力

  • 按 Subagents、Commands、Skills 等概念分类整理最佳实践
  • 每个概念都配可运行的实现示例与目录结构
  • 覆盖 Hooks、MCP、Plugins、Settings 等配置项
  • 收录编排工作流与多智能体协作的实践文档
  • 汇总 CLI 启动参数、内存与上下文管理技巧

容易踩的坑

仓库是文档与实践示例集合,不是可直接安装的软件包;多数功能依赖 Claude Code CLI 本体,需先自行安装;部分特性标注 beta,行为可能随版本变化

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    claude-code-best-practice

    from vibe coding to agentic engineering - practice makes claude perfect

    updated with Claude Code

    Best Practice Implemented Orchestration Workflow Claude Boris Community Click on these badges below to see the actual sources = Agents · = Commands · = Skills

    [!TIP] Visit the How to Use section to take full advantage of this repo.

    🧠 CONCEPTS

    FeatureLocationDescription
    Subagents.claude/agents/<name>.mdBest Practice Implemented
    Commands.claude/commands/<name>.mdBest Practice Implemented
    Skills.claude/skills/<name>/SKILL.mdBest Practice Implemented Official Skills · Skills for Mono-repos
    Workflows.claude/commands/weather-orchestrator.mdOrchestration Workflow
    Hooks.claude/hooks/Best Practice Implemented Guide
    MCP Servers.claude/settings.json, .mcp.jsonBest Practice Implemented
    Pluginsdistributable packagesMarketplaces · Create Marketplaces
    Settings.claude/settings.jsonBest Practice Implemented Permissions · Model Config · Output Styles · Sandboxing · Keybindings · Auto Mode Config
    Status Line.claude/settings.jsonBest Practice Implemented
    MemoryCLAUDE.md, .claude/rules/, ~/.claude/rules/, ~/.claude/projects/<project>/memory/Best Practice Implemented Auto Memory · Auto Memory Deep-dive · Rules
    Checkpointingautomatic (file-edit tracking)
    Sessions--resume, --continue, /resume, /branch
    Context Window/compact, /clear, /context
    CLI Startup Flagsclaude [flags]Best Practice Interactive Mode · Env Vars
    AI TermsBest Practice
    Best PracticesPrompt Engineering · Extend Claude Code
    Prompt Library

    🔥 Hot

    FeatureLocationDescription
    Ultrareview beta/code-review ultra, claude ultrareview [target]Tasks tracking
    Devcontainers.devcontainer/
    Channels beta--channels, plugin-basedReference
    No Flicker Mode beta/tui fullscreen, CLAUDE_CODE_NO_FLICKER=1Best Practice
    Auto Mode--permission-mode auto, Shift+TabBest Practice Blog
    Power-ups/powerupBest Practice
    Fast Mode beta/fast, "fastMode": true
    Advisor beta/advisor, advisorModel, --advisorBlog
    Computer Use betacomputer-use MCP serverDesktop
    Agent SDKnpm / pip packageQuickstart · Examples
    Ralph Wiggum LooppluginBest Practice Implemented
    Chrome--chrome, extensionBest Practice
    Claude Code Web betaclaude.ai/codeRoutines
    Artifacts/share, Artifact tool
    Slack@Claude in Slack
    Code ReviewGitHub App (managed)Best Practice Blog Local /code-review
    GitHub Actions.github/workflows/GitLab CI/CD
    Remote Control/remote-control, /rcBest Practice Headless Mode
    Deep Linksclaude-cli://open?repo=…&q=…
    Dynamic Workflows/workflows, ultracode keyword, /effort ultracode, .claude/workflows/Deep Research
    Agent Teams betabuilt-in (env var)Best Practice Implemented
    Agent View betaclaude agents, --bg, /bg
    Cross-Session MessagingSendMessage, ListAgents, /list-agents
    Scheduled Tasks/loop, /schedule, cron toolsBest Practice Implemented Desktop scheduled tasks · Announcement
    Routines betaclaude.ai/code/routines, /scheduleDesktop Tasks
    Tasks/tasks, ~/.claude/tasks/Best Practice Ultrareview tracking
    Goal/goal <condition>, /goal clearImplemented
    Voice Dictation/voiceBest Practice
    Bundled Skills/code-review, /batchBest Practice
    Git Worktrees--worktree/-w, .worktreeinclude, EnterWorktree/ExitWorktree, isolation: "worktree", WorktreeCreate/WorktreeRemove hooksBest Practice

    See orchestration-workflow for implementation details of Command → Agent → Skill pattern.

    How to Use

    claude
    /weather-orchestrator
    

    ⚙️ DEVELOPMENT WORKFLOWS

    All major workflows converge on the same architectural pattern: Research → Plan → Execute → Review → Ship

    Name★Workflow
    Matt Pocock Skills318k → → → → → → → 0039
    Superpowers314k → → → → → → → 0015
    Everything Claude Code299k → → → → → → 71112314
    Spec Kit148k → → → → → 0100
    gstack141k → → → → → → → → → → 0064
    agent-skills99.7k → → → → → 3721
    OpenSpec74.2k → → → → 01212
    Get Shit Done64.2k → → → → → → → 33850
    BMAD-METHOD55.1k → → → → → → 6033
    oh-my-claudecode40.7k → → → → → → → → 192148
    Compound Engineering26k → → → → → 0137
    HumanLayer12.8k → → → → → 0028

    Note: yellow tags are sub-loops — steps that repeat inside a parent step (e.g. per task, per story, or until a verify condition passes).

    Others

    🔀 CROSS-MODEL WORKFLOWS

    Use Claude Code together with other models — Codex, Gemini, GPT, Kimi, DeepSeek, local — via three mechanisms:

    • Plugin — another model's CLI runs inside Claude Code (slash commands like /codex:review)
    • MCP — Claude Code calls another model as a tool through Model Context Protocol
    • Router — Claude Code's API endpoint is swapped to a different provider

    Methodology: Cross-Model (Claude Code + Codex) Workflow Implemented — manual two-terminal flow with Plan in Claude, QA-Review in Codex.

    Name★TypeBridges toWhat it does
    musistudio/claude-code-router34kRouterOpenRouter, DeepSeek, Ollama, Gemini, Kimi, Qwen, Groq, +moreRoutes Claude Code's API to any compatible provider, with per-task model selection
    router-for-me/CLIProxyAPI32kRouterGemini CLI, Codex, Claude Code, AntigravityWraps each CLI as an OpenAI/Gemini/Claude/Codex-compatible API service
    openai/codex-plugin-cc18kPluginCodex / GPT-5Official OpenAI plugin: /codex:review, /codex:adversarial-review, /codex:rescue inside Claude Code
    BeehiveInnovations/pal-mcp-server12kMCPGemini, OpenAI, Azure, Grok, Ollama, OpenRouter (50+ models)Multi-model MCP server (formerly zen-mcp-server) — call other models as Claude tools

    🧰 SKILL COLLECTIONS

    Repos primarily known as curated libraries of SKILL.md files (distinct from full workflow methodologies above). Sorted by stars descending.

    Name★
    mattpocock/skills317k31
    anthropics/skills188k19
    Egonex-AI/Understand-Anything67k8
    scientific-agent-skills56k177
    wshobson/agents42k185
    awesome-agent-skills37k1,497+ (curated list)
    impeccable27k1 (with 7 design domain references)
    agent-skills27k21
    claude-skills15k246 (across 9 domains)
    shanraisshan/draw-json-architecture-skill31

    🤖 AGENT COLLECTIONS

    Repos primarily known as curated libraries of subagent definitions (.claude/agents/*.md). Sorted by stars descending.

    Name★
    msitarzewski/agency-agents167k283
    VoltAgent/awesome-claude-code-subagents26k170 (curated list)

    💡 TIPS AND TRICKS (83)

    🚫👶 = do not babysit

    Prompting · Planning · Context · Session · CLAUDE.md + .claude/rules · Agents · Commands · Skills · Hooks · Workflows · Advanced · Git / PR · Debugging · Utilities · Daily

    Community

    ■ Prompting (3)

    TipSource
    challenge Claude — "grill me on these changes and don't make a PR until I pass your test." or "prove to me this works" and have Claude diff between main and your branch 🚫👶Boris
    after a mediocre fix — "knowing everything you know now, scrap this and implement the elegant solution" 🚫👶Boris
    Claude fixes most bugs by itself — paste the bug, say "fix", don't micromanage how 🚫👶Boris

    ■ Planning/Specs (7)

    TipSource
    always start with plan modeBoris
    start with a minimal spec or prompt and ask Claude to interview you using AskUserQuestion tool, then make a new session to execute the specThariq
    always make a phase-wise gated plan, with each phase having multiple tests (unit, automation, integration)Dex Video
    break PRDs into vertical slices (tracer bullets) that cross all layers (DB + service + UI) — AI defaults to horizontal phasing (DB phase, then API phase, then frontend phase) which delays end-to-end feedback until the last phase. From the Pragmatic Programmer 🚫👶Matt Video
    spin up a second Claude to review your plan as a staff engineer, or use cross-model for reviewBoris
    write detailed specs and reduce ambiguity before handing work off — the more specific you are, the better the outputBoris
    prototype > PRD — build 20-30 versions instead of writing specs, the cost of building is low so take many shotsBoris Video

    ■ Context (5)

    TipSource
    context rot kicks in around ~300-400k tokens on the 1M context model — don't let sessions drift past that for intelligence-sensitive workThariq
    dumb zone kicks in around ~40% context — "you hit this point where you have degrading results". Newcomers: "shoot to keep it under 40%, and if you get up to 60%, think about wrapping it up". Experienced: "aggressively keep it below 30%" — push to 60% only on simple tasks. Manual /compact or /clear to reset when switching tasksDex Video
    rewind > correct — double-Esc or /rewind back to before the failed attempt and re-prompt with what you learned, instead of leaving failed attempts + corrections polluting context 🚫👶Thariq
    /compact with a hint (/compact focus on the auth refactor, drop the test debugging) beats letting autocompact fire — the model is at its least intelligent point when auto-compacting due to context rotThariq
    use subagents for context management — ask yourself "will I need this tool output again, or just the conclusion?" — 20 file reads + 12 greps + 3 dead ends stay in the child's context, only the final report returns 🚫👶Thariq

    ■ Session Management (6)

    TipSource
    every turn is a branching point — after Claude ends a turn, pick between Continue, /rewind, /clear, /compact, or Subagent based on how much existing context you need to carry forwardThariq
    new task = new session — related tasks (e.g. writing docs for what you just built) can reuse context for efficiency, but genuinely new tasks deserve a fresh sessionThariq
    use "summarize from here" before rewinding to have Claude write a handoff message — like a note to the previous iteration of Claude from its future selfThariq
    /compact vs /clear — compact is lossy but momentum-friendly (mid-task, fuzzy details ok); /clear + brief is more work but you control exactly what carries forward (high-stakes next step)Thariq
    use recaps for long-running sessions — short summaries of what Claude did and what's next, useful when returning after minutes or hours. Disable with recaps in /configBoris
    /rename important sessions (e.g. [TODO - refactor task]) and /resume them later — label each instance when running multiple Claudes simultaneouslyCat

    ■ CLAUDE.md + .claude/rules (8)

    TipSource
    CLAUDE.md should target under 200 lines per file. 60 lines in humanlayer (still not 100% guaranteed)Boris Dex
    .claude/rules/*.md auto-load into every session like CLAUDE.md — add paths: YAML frontmatter to lazy-load them only when Claude touches files matching the globClaude
    wrap domain-specific CLAUDE.md rules in <important if="..."> tags to stop Claude from ignoring them as files grow longerDex
    use multiple CLAUDE.md for monorepos — ancestor + descendant loadingBoris
    use .claude/rules/ to split large instructionsClaude
    any developer should be able to launch Claude, say "run the tests" and it works on the first try — if it doesn't, your CLAUDE.md is missing essential setup/build/test commandsDex
    keep codebases clean and finish migrations — partially migrated frameworks confuse models that might pick the wrong patternBoris Video
    use settings.json for harness-enforced behavior (attribution, permissions, model) — don't put "NEVER add Co-Authored-By" in CLAUDE.md when attribution.commit: "" is deterministicdavila7

    Agents (4)

    TipSource
    have feature specific sub-agents (extra context) with skills (progressive disclosure) instead of general qa, backend engineerBoris
    say "use subagents" to throw more compute at a problem — offload tasks to keep your main context clean and focused 🚫👶Boris
    agent teams with tmux and git worktrees for parallel developmentBoris
    use test time compute — separate context windows make results better; one agent can cause bugs and another (same model) can find themBoris

    Commands (3)

    TipSource
    use commands for your workflows instead of sub-agentsBoris
    use slash commands for every "inner loop" workflow you do many times a day — saves repeated prompting, commands live in .claude/commands/ and are checked into gitBoris
    if you do something more than once a day, turn it into a skill or command — build /techdebt, context-dump, or analytics commandsBoris

    Skills (9)

    TipSource
    use context: fork to run a skill in an isolated subagent — main context only sees the final result, not intermediate tool calls. The agent field lets you set the subagent typeLydia
    use skills in subfolders for monoreposClaude
    skills are folders, not files — use references/, scripts/, examples/ subdirectories for progressive disclosureThariq
    build a Gotchas section in every skill — highest-signal content, add Claude's failure points over timeThariq
    skill description field is a trigger, not a summary — write it for the model ("when should I fire?")Thariq
    don't state the obvious in skills — focus on what pushes Claude out of its default behavior 🚫👶Thariq
    don't railroad Claude in skills — give goals and constraints, not prescriptive step-by-step instructions 🚫👶Thariq
    include scripts and libraries in skills so Claude composes rather than reconstructs boilerplateThariq
    embed !command in SKILL.md to inject dynamic shell output into the prompt — Claude runs it on invocation and the model only sees the resultLydia

    ■ Hooks (5)

    TipSource
    use on-demand hooks in skills — /careful blocks destructive commands, /freeze blocks edits outside a directoryThariq
    measure skill usage with a PreToolUse hook to find popular or undertriggering skillsThariq
    use a PostToolUse hook to auto-format code — Claude generates well-formatted code, the hook handles the last 10% to avoid CI failuresBoris
    route permission requests to Opus via a hook — let it scan for attacks and auto-approve safe ones 🚫👶Boris
    use a Stop hook to nudge Claude to keep going or verify its work at the end of a turnBoris

    ■ Workflows (5)

    TipSource
    use /model to select model and reasoning, /context to see context usage, /usage to check plan limits, /extra-usage to configure overflow billing, /config to configure settings — use Opus for plan mode and Sonnet for code to get the best of bothCat
    always use thinking mode true (to see reasoning) and Output Style Explanatory (to see detailed output with ★ Insight boxes) in /config for better understanding of Claude's decisionsBoris
    use ultrathink keyword in prompts for high effort reasoningClaude
    /focus mode hides all intermediate work and shows only the final result — trust the model to run the right commands and just look at the outcome (toggle with /focus)Boris
    tune effort level with Opus 4.7's adaptive thinking — low for speed and fewer tokens, max for most intelligence (slider: low · medium · high · xhigh · max)Boris

    ■ Workflows Advanced (9)

    TipSource
    use ASCII diagrams a lot to understand your architectureBoris
    use /loop for local recurring monitoring (up to 7 days) · use /schedule for cloud-based recurring tasks that run even when your machine is offBoris
    use Ralph Wiggum plugin for long-running autonomous tasksBoris
    /permissions with wildcard syntax (Bash(npm run *), Edit(/docs/**)) instead of dangerously-skip-permissionsBoris
    /sandbox to reduce permission prompts with file and network isolation — 84% reduction internallyBoris Cat
    invest in product verification skills (signup-flow-driver, checkout-verifier) — worth spending a week to perfectThariq
    use auto mode instead of dangerously-skip-permissions — a model-based classifier decides if each command is safe and auto-approves, pauses and asks if risky. Shift+Tab to cycle Ask → Plan → Auto modes 🚫👶Boris
    use /less-permission-prompts skill to scan session history for safe bash/MCP commands that repeatedly prompt, then get a recommended allowlist to paste into settingsBoris
    build a /go skill that (1) tests end-to-end via bash/browser/computer use (2) runs /simplify (3) puts up a PR — so when you come back, you know the code works 🚫👶Boris

    ■ Git / PR (5)

    TipSource
    keep PRs small and focused — p50 of 118 lines (141 PRs, 45K lines changed in a day), one feature per PR, easier to review and revertBoris
    always squash merge PRs — clean linear history, one commit per feature, easy git revert and git bisectBoris
    commit often — try to commit at least once per hour, as soon as task is completed, commitShayan
    tag @claude on a coworker's PR to auto-generate lint rules for recurring review feedback — automate yourself out of code review 🚫👶Boris Video
    use /code-review for multi-agent PR analysis — catches bugs, security vulnerabilities, and regressions before mergeBoris

    ■ Debugging (6)

    TipSource
    make it a habit to take screenshots and share with Claude whenever you are stuck with any issueShayan
    use mcp (Claude in Chrome, Playwright, Chrome DevTools) to let claude see chrome console logs on its ownClaude
    always ask claude to run the terminal (you want to see logs of) as a background task for better debuggingShayan
    /doctor to diagnose installation, authentication, and configuration issuesShayan
    use a cross-model for QA — e.g. Codex for plan and implementation reviewShayan
    agentic search (glob + grep) beats RAG — Claude Code tried and discarded vector databases because code drifts out of sync and permissions are complexBoris Video

    ■ Utilities (5)

    TipSource
    iTerm/Ghostty/tmux terminals instead of IDE (VS Code/Cursor)Boris
    /voice or Wispr Flow for voice prompting (10x productivity)Boris
    claude-code-hooks for claude feedbackShayan
    status line for context awareness and fast compactingBoris Shayan
    explore settings.json features like Plans Directory, Spinner Verbs for a personalized experienceBoris

    ■ Daily (2)

    TipSource
    update Claude Code dailyShayan
    start your day by reading the changelogShayan

    Boris Cherny + Team

    Article / TweetSource
    6 Tips for Getting More Out of Opus 4.7 (Boris) | 16/Apr/26Tweet
    Session Management & 1M Context (Thariq) | 16/Apr/26Tweet
    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 — schedule recurring tasks for up to 3 days (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
    Tips from Claude code CLI binary

    Spinner Verbs & Tips (extracted from CLI binary v2.1.121)

    🎬 VIDEOS / PODCASTS

    Video / PodcastSourceYouTube
    From Vibe Coding to Agentic Engineering (Andrej) | 02 May 2026 | AI EngineerKarpathyYouTube
    Full Walkthrough: Workflow for AI Coding (Matt) | 24 Apr 2026 | Matt PocockMattYouTube
    Everything We Got Wrong About Research-Plan-Implement (Dex) | 24 Mar 2026 | MLOps CommunityDexYouTube
    Building Claude Code with Boris Cherny (Boris) | 04 Mar 2026 | The Pragmatic EngineerBorisYouTube
    Head of Claude Code: What happens after coding is solved (Boris) | 19 Feb 2026 | Lenny's PodcastBorisYouTube
    Inside Claude Code With Its Creator Boris Cherny (Boris) | 17 Feb 2026 | Y CombinatorBorisYouTube
    Boris Cherny (Creator of Claude Code) On What Grew His Career (Boris) | 15 Dec 2025 | Ryan PetermanBorisYouTube
    The Secrets of Claude Code From the Engineers Who Built It (Cat) | 29 Oct 2025 | EveryBorisYouTube

    🔔 SUBSCRIBE

    SourceNameBadge
    Redditr/ClaudeAI, r/ClaudeCode, r/AnthropicBoris + Team
    XClaude, Claude Devs, Anthropic, Boris, Thariq, Cat, Lydia, Noah, Anthony, Alex, KennethBoris + Team
    XJesse Kriss (Superpowers), Affaan Mustafa (ECC), Garry Tan (gstack), Dex Horthy (HumanLayer), Kieran Klaassen (Compound Eng), Tabish Gilani (OpenSpec), Brian McAdams (BMAD), Lex Christopherson (GSD), Matt Pocock (Skills), Dani Avila (CC Templates), Dan Shipper (Every), Andrej Karpathy (AutoResearch), Peter Steinberger (OpenClaw), Sigrid Jin (claw-code), Yeachan Heo (oh-my-claudecode)Community
    YouTubeAnthropicBoris + Team
    ![YouTube](https://