Back to Skill Directory

Knowledge Base

30K+ Stars#1 GitHub Trending

Claude Code Best Practice

by shanraisshan · 87+ tips · HTML documentation repo

The most comprehensive community-curated collection of Claude Code best practices. Covers every extension point — subagents, commands, skills, and orchestration workflows — with paired best-practice explanations and implementation examples. This is the repo developers read before building anything serious with Claude Code.

Unlike tool-based projects, claude-code-best-practice is a knowledge repository. It does not install anything or change Claude Code behavior directly. Instead, it teaches you the patterns and principles that make every other Claude Code tool — Superpowers, oh-my-claudecode, MCP servers, custom skills — work better. Understanding the “why” before automating the “how.”

Parallel Execution

Subagents

25+ tips

Slash Command Patterns

Commands

20+ tips

Behavioral Extensions

Skills

25+ tips

Multi-Agent Workflows

Orchestration

15+ tips

Coverage Areas

Subagents, Commands, Skills & Orchestration

Subagents

Parallel Execution25+ tips

Patterns for launching, coordinating, and synthesizing results from independent Claude Code subagents. Covers task delegation, context isolation, parallel execution strategies, and handling subagent failures gracefully.

Key Topics

  • Effective task decomposition for subagent delegation
  • Context passing without token waste
  • Parallel vs sequential subagent patterns
  • Result synthesis and conflict resolution

Best For

Developers working on large codebases where parallel analysis, review, and implementation save significant time.

Commands

Slash Command Patterns20+ tips

Best practices for building and using slash commands that trigger specific workflows. Covers prompt design, argument handling, output formatting, and composing commands into multi-step pipelines.

Key Topics

  • Writing effective command prompts
  • Argument parsing and validation patterns
  • Command chaining and composition
  • Error handling in command workflows

Best For

Teams standardizing development workflows across multiple developers using shared command libraries.

Skills

Behavioral Extensions25+ tips

Guidance on building skills that reshape Claude Code behavior for entire sessions. Covers system prompt design, tool configuration, activation triggers, and maintaining skill coherence across long conversations.

Key Topics

  • System prompt engineering for skills
  • Tool and permission configuration
  • Skill activation and deactivation patterns
  • Testing skills across different contexts

Best For

Developers building reusable methodology frameworks that enforce process discipline in Claude Code sessions.

Orchestration

Multi-Agent Workflows15+ tips

Advanced patterns for coordinating multiple agents, managing shared context, and building reliable multi-step development workflows. Covers plan-execute-verify loops, context compaction strategies, and cross-session continuity.

Key Topics

  • Plan-execute-verify workflow design
  • Context window management at scale
  • Cross-session state persistence
  • Multi-agent conflict resolution

Best For

Power users running complex development sessions that require structured coordination between multiple Claude Code instances.

Comparison

Best Practice vs Superpowers vs oh-my-claudecode

These three projects approach Claude Code mastery from different angles. Best Practice teaches the patterns. Superpowers enforces them automatically. oh-my-claudecode scales them across agent teams.

DimensionBest PracticeSuperpowersoh-my-claudecode
FocusKnowledge & patternsMethodology & automationTeam orchestration
FormatDocumentation repoInstallable skills frameworkCLI + npm package
Learning curveRead and applyInstall and followConfigure and run
Subagent coverageDeep (patterns)Deep (automated)Deep (team pipelines)
Best forUnderstanding whyEnforcing howScaling who

Practical Application

How to Use This Repository Effectively

1. Start with Subagents

Subagent patterns unlock the biggest productivity gains. Read the delegation and context-passing best practices first — they apply to every serious Claude Code workflow.

2. Build Your Command Library

Use the Commands section to design slash commands that match your team's workflow. Standardized commands reduce the learning curve for new developers joining the project.

3. Graduate to Skills

Once you have reliable commands, package them into skills that shape entire sessions. The Skills section covers system prompt design, activation triggers, and coherence testing.

4. Scale with Orchestration

The Orchestration section covers patterns for multi-agent coordination — the final level of Claude Code mastery where multiple agents work together on complex tasks.

Execution Brief

Use this page as a rollout checklist, not just reference text.

Suggest update

Tool Mapping Lens

Organize Tools by Workflow Phase

Catalog-oriented pages work best when users can map discovery, evaluation, and rollout in a clear path instead of reading an undifferentiated list.

  • Define the job-to-be-done first
  • Group tools by stage
  • Prioritize by adoption friction

Actionable Utility Module

Skill Implementation Board

Use this board for Claude Code Best Practice before rollout. Capture inputs, apply one decision rule, execute the checklist, and log outcome.

Input: Objective

Deliver one measurable improvement with claude code best practices

Input: Baseline Window

20-30 minutes

Input: Fallback Window

8-12 minutes

Decision TriggerActionExpected Output
Input: one workflow objective and release owner are definedRun preview execution with fixed acceptance criteria.Go or hold decision backed by repeatable evidence.
Input: output quality below baseline or retries increaseLimit scope, isolate root issue, and rerun controlled test.One confirmed correction path before wider rollout.
Input: checks pass for two consecutive replay windowsPromote to broader traffic with fallback path active.Stable rollout with low operational surprise.

Execution Steps

  1. Record objective, owner, and stop condition.
  2. Execute one controlled preview run.
  3. Measure quality, latency, and correction burden.
  4. Promote only when pass criteria are stable.

Output Template

tool=claude code best practices
objective=
preview_result=pass|fail
primary_metric=
next_step=rollout|patch|hold

What Is Claude Code Best Practice?

Claude Code Best Practice is the community's definitive reference for building with Claude Code effectively. Created by shanraisshan and maintained by a growing contributor base, it catalogs over 87 tips organized around Claude Code's three extension points: subagents for parallel execution, commands for reusable workflows, and skills for session-wide behavioral control.

Each tip follows a paired format: one document explains the best practice and the reasoning behind it, and a companion document shows the implementation. This structure is deliberate — it prevents the common failure of developers copying patterns without understanding when they apply and when they break down.

The repository also includes an Orchestration section covering multi-agent coordination patterns that go beyond any single extension point. These patterns address the hardest problems in Claude Code usage: managing context across long sessions, coordinating multiple agents working on the same codebase, and building reliable plan-execute-verify loops that produce consistent results.

The project reached #1 on GitHub Trending and has accumulated over 30,000 stars, making it one of the most popular developer resources in the Claude Code ecosystem. It serves as prerequisite reading for developers who plan to build custom skills, contribute to frameworks like Superpowers, or design multi-agent development workflows.

How to Calculate Better Results with claude code best practices

Start by reading the Subagents section if you are working on a codebase large enough to benefit from parallel analysis. The delegation patterns and context-passing strategies in this section directly improve the productivity of any workflow that uses subagent_type parameters in Claude Code.

Move to the Commands section when you find yourself repeating the same prompts across sessions. The command design patterns show how to build reliable slash commands that other developers on your team can use without understanding the underlying prompt engineering.

Study the Skills section before building any custom skills. The system prompt design guidance and activation pattern documentation will save significant iteration time compared to learning through trial and error. Pay particular attention to the coherence testing tips — skills that work in short sessions often drift in long ones.

Reference the Orchestration section when planning complex multi-step workflows. The plan-execute-verify loop patterns and context compaction strategies are especially valuable for sessions that approach or exceed the context window limit.

Treat this page as a decision map. Build a shortlist fast, then run a focused second pass for security, ownership, and operational fit.

When a team keeps one shared selection rubric, tool adoption speeds up because evaluators stop debating criteria every time a new option appears.

Worked Examples

Example 1: Applying subagent delegation patterns to a monorepo refactor

  1. Developer reads the subagent delegation best practices before starting a cross-package refactor in a monorepo.
  2. Instead of processing packages sequentially, they launch parallel subagents for type checking, test validation, and dependency analysis.
  3. Each subagent receives minimal context — only the package boundary and the refactor specification — following the context isolation pattern.
  4. Results from subagents are synthesized in the parent session using the conflict resolution pattern from the Orchestration section.

Outcome: A refactor that would have taken a full session is completed in a fraction of the time with better coverage, because the developer applied proven patterns rather than discovering them through trial and error.

Example 2: Building a team command library from best practices

  1. A team of four developers standardizes their Claude Code usage by building a shared command library based on the Commands section.
  2. They implement /review, /test, /deploy, and /security commands following the prompt design and argument handling patterns.
  3. New team members can use the commands immediately without understanding the underlying prompt engineering.
  4. The commands evolve based on team feedback, with each iteration informed by the error handling and composition patterns.

Outcome: The team achieves consistent code quality across all developers, with command-level standardization replacing individual prompt variation.

Example 3: Designing a custom skill using the skills best practices

  1. Developer uses the Skills section to design a custom TDD skill that enforces test-first development.
  2. The system prompt is designed following the coherence testing guidelines, tested across both short and long sessions.
  3. Activation triggers are configured so the skill engages only when the developer starts a feature or bugfix task.
  4. The skill is packaged and shared with the team as a reusable behavioral extension.

Outcome: The custom skill reliably enforces TDD workflow discipline across sessions of varying length and complexity, because it was designed against documented best practices rather than ad-hoc experimentation.

Frequently Asked Questions

What is claude-code-best-practice?

claude-code-best-practice is an open-source GitHub repository by shanraisshan that collects over 87 best practices, tips, and implementation patterns for Claude Code. It covers all three Claude Code extension points — subagents, commands, and skills — with paired documentation for each: one file explaining the best practice and another showing the implementation. The repo hit #1 trending on GitHub.

Who maintains claude-code-best-practice?

The repository is maintained by Shan Rais (shanraisshan on GitHub) with contributions from the Claude Code community. It incorporates tips from Anthropic engineers including Boris Cherny and patterns discovered by power users working on production codebases.

How is claude-code-best-practice organized?

The repo is organized by Claude Code extension point: Subagents, Commands, and Skills. Each section contains numbered best-practice documents with a matching implementation file. There is also a dedicated Orchestration Workflow section covering multi-agent coordination patterns, parallel task execution, and context management strategies.

What are Claude Code subagents and why do they matter?

Subagents are independent Claude Code instances that a parent session can launch to handle subtasks in parallel. They matter because they unlock horizontal scaling of development work — a single developer can run code review, testing, documentation, and implementation simultaneously. The best-practice repo documents patterns for effective subagent delegation, context passing, and result synthesis.

How do Claude Code commands differ from skills?

Commands are user-invokable slash commands (like /commit or /review) that trigger predefined prompts or workflows. Skills are more comprehensive — they include system prompts, tool configurations, and behavioral instructions that shape how Claude Code works throughout a session. The best-practice repo covers when to use each and how to build effective implementations of both.

Can I contribute to claude-code-best-practice?

Yes. The repository accepts community contributions. The standard format is a paired submission: a best-practice document explaining the principle and an implementation document showing how to apply it. Check the repository README for contribution guidelines and open issues for requested topics.

How does this compare to the official Anthropic documentation?

The official Anthropic docs cover Claude Code features and APIs. claude-code-best-practice goes deeper on practical usage patterns — the kind of knowledge that comes from extended production use rather than feature documentation. Think of it as the community-curated companion to the official docs, focusing on what works in practice rather than what is available in theory.

Missing a better tool match?

Send the exact workflow you are solving and we will prioritize a new comparison or rollout guide.