claude-code-best-practice
practice makes claude perfect
<a href="https://github.com/shanraisshan/claude-code-best-practice/stargazers"><img src="https://img.shields.io/github/stars/shanraisshan/claude-code-best-practice?style=flat&label=%E2%98%85&labelColor=555&color=white" alt="GitHub Stars"></a><br>
<br>
<img src="!/tags/a.svg" height="14"> = Agents Β· <img src="!/tags/c.svg" height="14"> = Commands Β· <img src="!/tags/s.svg" height="14"> = Skills
π§ CONCEPTS
| Feature | Location | Description |
|---|---|---|
| <img src="!/tags/a.svg" height="14"> Subagents | .claude/agents/<name>.md | |
| <img src="!/tags/c.svg" height="14"> Commands | .claude/commands/<name>.md | |
| <img src="!/tags/s.svg" height="14"> Skills | .claude/skills/<name>/SKILL.md | |
| Workflows | .claude/commands/weather-orchestrator.md | |
| Hooks | .claude/hooks/ | |
| MCP Servers | .claude/settings.json, .mcp.json | |
| Plugins | distributable packages | Bundles of skills, subagents, hooks, MCP servers, and LSP servers Β· Marketplaces Β· Create Marketplaces |
| Settings | .claude/settings.json | |
| Status Line | .claude/settings.json | |
| Memory | CLAUDE.md, .claude/rules/, ~/.claude/rules/, ~/.claude/projects/<project>/memory/ | @path imports Β· Auto Memory Β· Rules |
| Checkpointing | automatic (git-based) | Automatic tracking of file edits with rewind (Esc Esc or /rewind) and targeted summarization |
| CLI Startup Flags | claude [flags] | |
| AI Terms | ||
| Best Practices | Official best practices Β· Prompt Engineering Β· Extend Claude Code |
π₯ Hot
| Feature | Location | Description |
|---|---|---|
| Auto Mode | --permission-mode auto | |
| Channels | --channels, plugin-based | Push events from Telegram, Discord, or webhooks into a running session β Claude reacts while you're away Β· Reference |
| Slack | @Claude in Slack | Mention @Claude in team chat with a coding task β routes to Claude Code web sessions for bug fixes, code reviews, and parallel task execution |
| Code Review | GitHub App (managed) | |
| GitHub Actions | .github/workflows/ | Automate PR reviews, issue triage, and code generation in CI/CD pipelines Β· GitLab CI/CD |
| Chrome | --chrome, extension | |
| Scheduled Tasks | /loop, /schedule, cron tools | /loop runs prompts locally on a recurring schedule (up to 3 days) Β· /schedule runs prompts in the cloud on Anthropic infrastructure β works even when your machine is off Β· Announcement |
| Voice Dictation | /voice | |
| Simplify & Batch | /simplify, /batch | |
| Agent Teams | built-in (env var) | |
| Remote Control | /remote-control, /rc | |
| Git Worktrees | built-in | |
| Ralph Wiggum Loop | plugin |
<a id="orchestration-workflow"></a>
<a href="orchestration-workflow/orchestration-workflow.md"><img src="!/tags/orchestration-workflow-hd.svg" alt="Orchestration Workflow"></a>
See orchestration-workflow for implementation details of <img src="!/tags/c.svg" height="14"> Command β <img src="!/tags/a.svg" height="14"> Agent β <img src="!/tags/s.svg" height="14"> Skill pattern.
<p align="center"> <img src="orchestration-workflow/orchestration-workflow.svg" alt="Command Skill Agent Architecture Flow" width="100%"> </p> <p align="center"> <img src="orchestration-workflow/orchestration-workflow.gif" alt="Orchestration Workflow Demo" width="600"> </p>claude
/weather-orchestrator
<p align="center">
<img src="!/claude-jumping.svg" alt="section divider" width="60" height="50">
</p>
βοΈ DEVELOPMENT WORKFLOWS
All major workflows converge on the same architectural pattern: Research β Plan β Execute β Review β Ship
| Name | β | Uniqueness | Plan | <img src="!/tags/a.svg" height="14"> | <img src="!/tags/c.svg" height="14"> | <img src="!/tags/s.svg" height="14"> |
|---|---|---|---|---|---|---|
| Superpowers | 127k | <img src="!/tags/s.svg" height="14"> writing-plans | 5 | 3 | 14 | |
| Everything Claude Code | 124k | <img src="!/tags/a.svg" height="14"> planner | 30 | 63 | 135 | |
| Spec Kit | 84k | <img src="!/tags/c.svg" height="14"> speckit.plan | 0 | 9+ | 0 | |
| gstack | 59k | <img src="!/tags/s.svg" height="14"> autoplan | 0 | 0 | 32 | |
| Get Shit Done | 46k | <img src="!/tags/a.svg" height="14"> gsd-planner | 18 | 57 | 0 | |
| BMAD-METHOD | 43k | <img src="!/tags/s.svg" height="14"> bmad-create-prd | 0 | 0 | 43 | |
| OpenSpec | 36k | <img src="!/tags/c.svg" height="14"> opsx:propose | 0 | 11 | 0 | |
| Compound Engineering | 12k | <img src="!/tags/s.svg" height="14"> ce-plan | 48 | 4 | 42 | |
| HumanLayer | 10k | <img src="!/tags/c.svg" height="14"> create_plan | 6 | 27 | 0 |
Others
- Cross-Model (Claude Code + Codex) Workflow
- RPI
- Ralph Wiggum Loop
- Andrej Karpathy (Founding Member, OpenAI) Workflow
- Peter Steinberger (Creator of OpenClaw) Workflow
- Boris Cherny (Creator of Claude Code) Workflow β 13 Tips Β· 10 Tips Β· 12 Tips Β· 2 Tips Β· 15 Tips
π‘ TIPS AND TRICKS (87)
π«πΆ = do not babysit
Prompting Β· Planning Β· CLAUDE.md Β· Agents Β· Commands Β· Skills Β· Hooks Β· Workflows Β· Advanced Β· Git / PR Β· Debugging Β· Utilities Β· Daily
<a id="tips-prompting"></a>β Prompting (3)
<a id="tips-planning"></a>β Planning/Specs (6)
| Tip | Source |
|---|---|
| always start with plan mode | |
| start with a minimal spec or prompt and ask Claude to interview you using AskUserQuestion tool, then make a new session to execute the spec | |
| always make a phase-wise gated plan, with each phase having multiple tests (unit, automation, integration) | |
| spin up a second Claude to review your plan as a staff engineer, or use cross-model for review | |
| write detailed specs and reduce ambiguity before handing work off β the more specific you are, the better the output | |
| prototype > PRD β build 20-30 versions instead of writing specs, the cost of building is low so take many shots |
<a id="tips-claudemd"></a>β CLAUDE.md (7)
| Tip | Source |
|---|---|
| CLAUDE.md should target under 200 lines per file. 60 lines in humanlayer (still not 100% guaranteed) | |
| wrap domain-specific CLAUDE.md rules in <important if="..."> tags to stop Claude from ignoring them as files grow longer | |
| use multiple CLAUDE.md for monorepos β ancestor + descendant loading | |
| use .claude/rules/ to split large instructions | |
| memory.md, constitution.md does not guarantee anything | |
| 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 commands | |
| keep codebases clean and finish migrations β partially migrated frameworks confuse models that might pick the wrong pattern | |
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 deterministic |
<a id="tips-agents"></a><img src="!/tags/a.svg" height="14"> Agents (4)
| Tip | Source |
|---|---|
| have feature specific sub-agents (extra context) with skills (progressive disclosure) instead of general qa, backend engineer | |
| say "use subagents" to throw more compute at a problem β offload tasks to keep your main context clean and focused π«πΆ | |
| agent teams with tmux and git worktrees for parallel development | |
| use test time compute β separate context windows make results better; one agent can cause bugs and another (same model) can find them |
<a id="tips-commands"></a><img src="!/tags/c.svg" height="14"> Commands (3)
| Tip | Source |
|---|---|
| use commands for your workflows instead of sub-agents | |
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 git | |
if you do something more than once a day, turn it into a skill or command β build /techdebt, context-dump, or analytics commands |
<a id="tips-skills"></a><img src="!/tags/s.svg" height="14"> Skills (9)
| Tip | Source |
|---|---|
| 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 type | |
| use skills in subfolders for monorepos | |
| skills are folders, not files β use references/, scripts/, examples/ subdirectories for progressive disclosure | |
| build a Gotchas section in every skill β highest-signal content, add Claude's failure points over time | |
| skill description field is a trigger, not a summary β write it for the model ("when should I fire?") | |
| don't state the obvious in skills β focus on what pushes Claude out of its default behavior π«πΆ | |
| don't railroad Claude in skills β give goals and constraints, not prescriptive step-by-step instructions π«πΆ | |
| include scripts and libraries in skills so Claude composes rather than reconstructs boilerplate | |
embed !`command` in SKILL.md to inject dynamic shell output into the prompt β Claude runs it on invocation and the model only sees the result |
<a id="tips-hooks"></a>β Hooks (5)
| Tip | Source |
|---|---|
| use on-demand hooks in skills β /careful blocks destructive commands, /freeze blocks edits outside a directory | |
| measure skill usage with a PreToolUse hook to find popular or undertriggering skills | |
| use a PostToolUse hook to auto-format code β Claude generates well-formatted code, the hook handles the last 10% to avoid CI failures | |
| route permission requests to Opus via a hook β let it scan for attacks and auto-approve safe ones π«πΆ | |
| use a Stop hook to nudge Claude to keep going or verify its work at the end of a turn |
<a id="tips-workflows"></a>β Workflows (7)
| Tip | Source |
|---|---|
| avoid agent dumb zone, do manual /compact at max 50%. Use /clear to reset context mid-session if switching to a new task | |
| vanilla cc is better than any workflows with smaller tasks | |
| 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 both | |
| 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 decisions | |
| use ultrathink keyword in prompts for high effort reasoning | |
| /rename important sessions (e.g. [TODO - refactor task]) and /resume them later β label each instance when running multiple Claudes simultaneously | |
| use Esc Esc or /rewind to undo when Claude goes off-track instead of trying to fix it in the same context |
<a id="tips-workflows-advanced"></a>β Workflows Advanced (6)
| Tip | Source |
|---|---|
| use ASCII diagrams a lot to understand your architecture | |
| use /loop for local recurring monitoring (up to 3 days) Β· use /schedule for cloud-based recurring tasks that run even when your machine is off | |
| use Ralph Wiggum plugin for long-running autonomous tasks | |
| /permissions with wildcard syntax (Bash(npm run *), Edit(/docs/**)) instead of dangerously-skip-permissions | |
| /sandbox to reduce permission prompts with file and network isolation β 84% reduction internally | |
| invest in product verification skills (signup-flow-driver, checkout-verifier) β worth spending a week to perfect |
<a id="tips-git-pr"></a>β Git / PR (5)
| Tip | Source |
|---|---|
| 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 revert | |
| always squash merge PRs β clean linear history, one commit per feature, easy git revert and git bisect | |
| commit often β try to commit at least once per hour, as soon as task is completed, commit | |
| tag @claude on a coworker's PR to auto-generate lint rules for recurring review feedback β automate yourself out of code review π«πΆ | |
| use /code-review for multi-agent PR analysis β catches bugs, security vulnerabilities, and regressions before merge |
<a id="tips-debugging"></a>β Debugging (7)
| Tip | Source |
|---|---|
| make it a habit to take screenshots and share with Claude whenever you are stuck with any issue | |
| use mcp (Claude in Chrome, Playwright, Chrome DevTools) to let claude see chrome console logs on its own | |
| always ask claude to run the terminal (you want to see logs of) as a background task for better debugging | |
| /doctor to diagnose installation, authentication, and configuration issues | |
| error during compaction can be resolved by using /model to select a 1M token model, then running /compact | |
| use a cross-model for QA β e.g. Codex for plan and implementation review | |
| agentic search (glob + grep) beats RAG β Claude Code tried and discarded vector databases because code drifts out of sync and permissions are complex |
<a id="tips-utilities"></a>β Utilities (5)
| Tip | Source |
|---|---|
| iTerm/Ghostty/tmux terminals instead of IDE (VS Code/Cursor) | |
| Wispr Flow for voice prompting (10x productivity) | |
| claude-code-hooks for claude feedback | |
| status line for context awareness and fast compacting | |
| explore settings.json features like Plans Directory, Spinner Verbs for a personalized experience |
<a id="tips-daily"></a>β Daily (4)
| Tip | Source |
|---|---|
| update Claude Code daily and start your day by reading the changelog | |
| follow r/ClaudeAI, r/ClaudeCode | |
| follow Boris, Thariq, Cat, Lydia, Noah, Anthony, Alex, Kenneth, Claude | |
| follow Jesse, Affaan, Garry, Dex, Kieran, Tabish, Brian, TΓCHES, Dani, Dan, Karpathy |
| Video / Podcast | Source | YouTube |
|---|---|---|
| Everything We Got Wrong About Research-Plan-Implement (Dex) | 24 Mar 2026 | MLOps Community | YouTube | |
| Building Claude Code with Boris Cherny (Boris) | 04 Mar 2026 | The Pragmatic Engineer | YouTube | |
| Head of Claude Code: What happens after coding is solved (Boris) | 19 Feb 2026 | Lenny's Podcast | YouTube | |
| Inside Claude Code With Its Creator Boris Cherny (Boris) | 17 Feb 2026 | Y Combinator | YouTube | |
| Boris Cherny (Creator of Claude Code) On What Grew His Career (Boris) | 15 Dec 2025 | Ryan Peterman | YouTube | |
| The Secrets of Claude Code From the Engineers Who Built It (Cat) | 29 Oct 2025 | Every | YouTube |
β οΈ STARTUPS / BUSINESSES
| Claude | Replaced |
|---|---|
| Code Review | Greptile, CodeRabbit, Devin Review, OpenDiff, Cursor BugBot |
| Voice Dictation | Wispr Flow, SuperWhisper |
| Remote Control | OpenClaw |
| Cowork | OpenAI Operator, AgentShadow |
| Tasks | Beads |
| Plan Mode | Agent OS |
| Skills / Plugins | YC AI wrapper startups (reddit) |
<a id="billion-dollar-questions"></a>
If you have answers, do let me know at shanraisshan@gmail.com
Memory & Instructions (4)
- What exactly should you put inside your CLAUDE.md β and what should you leave out?
- If you already have a CLAUDE.md, is a separate constitution.md or rules.md actually needed?
- How often should you update your CLAUDE.md, and how do you know when it's become stale?
- Why does Claude still ignore CLAUDE.md instructions β even when they say MUST in all caps? (reddit)
Agents, Skills & Workflows (6)
- When should you use a command vs an agent vs a skill β and when is vanilla Claude Code just better?
- How often should you update your agents, commands, and workflows as models improve?
- Does giving your subagent a detailed persona improve quality? What does a "perfect persona/prompt" for research/QA subagent look like?
- Should you rely on Claude Code's built-in plan mode β or build your own planning command/agent that enforces your team's workflow?
- If you have a personal skill (e.g., /implement with your coding style), how do you incorporate community skills (e.g., /simplify) without conflicts β and who wins when they disagree?
- Are we there yet? Can we convert an existing codebase into specs, delete the code, and have AI regenerate the exact same code from those specs alone?
Specs & Documentation (3)
- Should every feature in your repo have a spec as a markdown file?
- How often do you need to update specs so they don't become obsolete when a new feature is implemented?
- When implementing a new feature, how do you handle the ripple effect on specs for other features?
REPORTS
<p align="center"> <a href="reports/claude-agent-sdk-vs-cli-system-prompts.md"><img src="https://img.shields.io/badge/Agent_SDK_vs_CLI-555?style=for-the-badge" alt="Agent SDK vs CLI"></a> <a href="reports/claude-in-chrome-v-chrome-devtools-mcp.md"><img src="https://img.shields.io/badge/Browser_Automation_MCP-555?style=for-the-badge" alt="Browser Automation MCP"></a> <a href="reports/claude-global-vs-project-settings.md"><img src="https://img.shields.io/badge/Global_vs_Project_Settings-555?style=for-the-badge" alt="Global vs Project Settings"></a> <a href="reports/claude-skills-for-larger-mono-repos.md"><img src="https://img.shields.io/badge/Skills_in_Monorepos-555?style=for-the-badge" alt="Skills in Monorepos"></a> <br> <a href="reports/claude-agent-memory.md"><img src="https://img.shields.io/badge/Agent_Memory-555?style=for-the-badge" alt="Agent Memory"></a> <a href="reports/claude-advanced-tool-use.md"><img src="https://img.shields.io/badge/Advanced_Tool_Use-555?style=for-the-badge" alt="Advanced Tool Use"></a> <a href="reports/claude-usage-and-rate-limits.md"><img src="https://img.shields.io/badge/Usage_&_Rate_Limits-555?style=for-the-badge" alt="Usage & Rate Limits"></a> <a href="reports/claude-agent-command-skill.md"><img src="https://img.shields.io/badge/Agents_vs_Commands_vs_Skills-555?style=for-the-badge" alt="Agents vs Commands vs Skills"></a> <br> <a href="reports/llm-day-to-day-degradation.md"><img src="https://img.shields.io/badge/LLM_Degradation-555?style=for-the-badge" alt="LLM Degradation"></a> </p> <p align="center"> <img src="!/claude-jumping.svg" alt="section divider" width="60" height="50"> </p>1. Read the repo like a course, learn what commands, agents, skills, and hooks are before trying to use them.
2. Clone this repo and play with the examples, try /weather-orchestrator, listen to the hook sounds, run agent teams, so you can see how things actually work.
3. Go to your own project and ask Claude to suggest what best practices from this repo you should add, give it this repo as a reference so it knows what's possible.
<p align="center">
<img src="!/claude-jumping.svg" alt="section divider" width="60" height="50">
</p>
<p align="center">
<a href="https://github.com/trending?since=monthly"><img src="!/root/github-trending.png" alt="GitHub Trending" width="1200"></a><br>
β¨Trending on Github in March 2026β¨
</p>
Other Repos
<a href="https://github.com/shanraisshan/claude-code-hooks"><img src="!/claude-speaking.svg" alt="Claude Code Hooks" width="40" height="40" align="center"></a> <a href="https://github.com/shanraisshan/claude-code-hooks"><strong>claude-code-hooks</strong></a> Β· <a href="https://github.com/shanraisshan/codex-cli-best-practice"><img src="!/codex-jumping.svg" alt="Codex CLI" width="40" height="40" align="center"></a> <a href="https://github.com/shanraisshan/codex-cli-best-practice"><strong>codex-cli-best-practice</strong></a> Β· <a href="https://github.com/shanraisshan/codex-cli-hooks"><img src="!/codex-speaking.svg" alt="Codex CLI Hooks" width="40" height="40" align="center"></a> <a href="https://github.com/shanraisshan/codex-cli-hooks"><strong>codex-cli-hooks</strong></a>
Developed by
Workflow Description /workflows:development-workflows Update the DEVELOPMENT WORKFLOWS table and cross-workflow analysis report by researching all 8 workflow repos in parallel /workflows:best-practice:workflow-concepts Update the README CONCEPTS section with the latest Claude Code features and concepts /workflows:best-practice:workflow-claude-settings Track Claude Code settings report changes and find what needs updating /workflows:best-practice:workflow-claude-subagents Track Claude Code subagents report changes and find what needs updating /workflows:best-practice:workflow-claude-commands Track Claude Code commands report changes and find what needs updating /workflows:best-practice:workflow-claude-skills Track Claude Code skills report changes and find what needs updating