Skip to content

Commands Reference

Claude Code commands are slash commands that automate workflows and provide structured assistance.

How to Use Commands

Type a slash command in Claude Code:

/common:pre-commit-check
/symfony:generate-crud User
/react:generate-component Button

Commands can take arguments:

/command:name argument1 argument2

Plan Mode Classification

Every command includes a Plan Mode section that indicates when Claude should activate plan mode before executing. This ensures proper analysis and validation for impactful operations.

LevelDescriptionExample Commands
MANDATORYPlan mode activates automatically before execution. Claude analyzes impacted code and proposes a plan for your validation./workflow:implement, /qa:tdd, /qa:recette, generate-* commands
RECOMMENDEDPlan mode is recommended for complex scenarios. Activates when scope spans multiple modules./workflow:plan, /workflow:design, /common:architecture-decision
CONDITIONALPlan mode activates automatically when scope is broad (multiple modules, cross-cutting analysis).check-* commands, /workflow:analyze, /common:research-context7

Tip: Commands without a Plan Mode section (e.g., /workflow:status, /common:daily-standup) are lightweight and never require plan mode.


Command Namespaces

NamespaceTechnologyCount
/common:Transversal14
/workflow:Workflow (BMAD)9
/team:Agent Teams4
/qa:QA & Testing6
/uiux:UI/UX & Accessibility7
/symfony:PHP/Symfony10
/flutter:Dart/Flutter10
/python:Python10
/react:React/TypeScript10
/reactnative:React Native10
/angular:Angular6
/csharp:C#/.NET6
/laravel:PHP/Laravel6
/vuejs:Vue.js6
/php:PHP5
/docker:Docker/Infrastructure5
/coolify:Coolify/PaaS5
/kubernetes:Kubernetes/Infrastructure5
/opentofu:OpenTofu/IaC5
/ansible:Ansible/Automation5
/hcloud:Hcloud/Hetzner Cloud5
/pgbouncer:PgBouncer/Connection Pooling5
/frankenphp:FrankenPHP/PHP Server5
/project:Project Management34
/sprint:Sprint Management (BMAD v6)5
/gate:Quality Gates (BMAD v6)7

Common Commands (/common:)

Transversal commands for all projects.

Workflow Commands

CommandDescription
/common:pre-commit-checkValidate code before commit
/common:pre-merge-checkValidate code before merge
/common:release-checklistPre-release validation

Generation Commands

CommandDescription
/common:generate-changelogGenerate changelog from commits
/common:architecture-decisionDocument an ADR

Sprint Commands

CommandDescription
/workflow:startInitialize a new sprint
/workflow:reviewGenerate sprint review summary
/workflow:retroConduct sprint retrospective
/common:daily-standupGenerate standup summary

Configuration Commands

CommandDescription
/common:setup-project-contextInteractive project context configuration
/common:setup-rtkInstall and configure RTK (token optimization)

Continuous Loop Commands

CommandDescription
/common:ralph-runRun Claude in continuous loop until DoD passes

Ralph Wiggum executes Claude iteratively until the task is complete:

bash
/common:ralph-run "Implement user authentication"
/common:ralph-run --full "Fix the login bug"  # With all DoD checks

Definition of Done validators:

  • command: Run tests, lint, build
  • output_contains: Check for completion marker
  • file_changed: Verify documentation updated
  • hook: Integrate with quality-gate.sh
  • human: Manual approval gate

Note: /common:full-audit and /common:ralph-sprint were removed in v6.0. Use /team:audit --sequential and /team:sprint --ralph-mode instead. See Migration Guide.

DevOps Commands

CommandDescription
/common:setup-ciConfigure CI/CD pipeline
/docker:optimizeOptimize Docker configuration

Development Commands

CommandDescription
/qa:tddFix bug using TDD methodology
/common:research-context7Deep technical research

UI/UX Commands

CommandDescription
/uiux:orchestratorOrchestrate UI, UX, and A11y experts for a task
/uiux:auditComplete UI/UX/Accessibility audit
/uiux:component-specFull component specification (UI + UX + A11y)
/uiux:design-tokensDefine design system tokens
/uiux:user-flowDesign user journey and flow
/uiux:a11y-auditWCAG 2.2 AAA accessibility audit
/uiux:a11y-componentAccessibility specs for a component

Technology Commands

CommandDescription
/common:add-technologyAdd a new technology to claude-craft

Add a complete technology stack to claude-craft with best practices:

bash
/common:add-technology "nextjs"
/common:add-technology "golang" backend

Features:

  • Context7 MCP research: Official documentation, best practices, design patterns
  • Web search: 2026 trends, community practices, common pitfalls
  • Full generation: Rules, commands, templates, skills, agents (5 languages)
  • Installation script: install-{tech}-rules.sh
  • Documentation updates: README, landing page, Makefile

Definition of Done:

  • [ ] Rules (7 files × 5 languages)
  • [ ] Commands (5 files × 5 languages)
  • [ ] Installation script created
  • [ ] README.md updated
  • [ ] docs/index.html updated (stats + tech card)
  • [ ] Makefile target added

Agent Teams Commands

CommandDescription
/team:auditParallel multi-tech audit (Agent Teams)
/team:sprintParallel sprint implementation (Agent Teams)
/team:securityParallel security review (Agent Teams)
/team:deliveryFull sprint lifecycle — writing + implementation (Agent Teams)
/common:sub-agents-patternsSub-agent orchestration patterns for Agent Teams

Workflow Commands (/workflow:)

BMAD-inspired workflow system adapted to project complexity.

CommandDescription
/workflow:initInitialize workflow (auto-detect track)
/workflow:analyzeResearch and exploration phase
/workflow:planGenerate PRD, personas, backlog
/workflow:designTech spec, architecture, ADRs
/workflow:implementSprint development with TDD/BDD
/workflow:statusShow current progress
/workflow:retroSprint retrospective
/workflow:reviewSprint review summary
/workflow:startStart a new sprint

Symfony Commands (/symfony:)

PHP backend development with Symfony.

Code Generation

CommandDescription
/symfony:generate-crud <Entity>Generate CRUD operations
/symfony:generate-command <Name>Generate CLI command
/symfony:api-endpoint <Resource>Generate API endpoint

Analysis Commands

CommandDescription
/symfony:check-architectureValidate Clean Architecture
/symfony:check-code-qualityRun code quality checks
/symfony:check-complianceCheck DDD compliance
/symfony:check-securitySecurity audit
/symfony:check-testingTest coverage analysis

Database Commands

CommandDescription
/symfony:migration-plan <Change>Plan database migration
/symfony:optimize-doctrineOptimize Doctrine queries

Flutter Commands (/flutter:)

Mobile development with Flutter/Dart.

Code Generation

CommandDescription
/flutter:generate-feature <Name>Generate feature module
/flutter:generate-widget <Name>Generate widget

Analysis Commands

CommandDescription
/flutter:check-architectureValidate architecture
/flutter:check-code-qualityRun code quality checks
/flutter:check-complianceCheck rule compliance
/flutter:check-securitySecurity audit
/flutter:check-testingTest coverage analysis
/flutter:analyze-performancePerformance analysis

Testing Commands

CommandDescription
/flutter:golden-updateUpdate golden files

Localization Commands

CommandDescription
/flutter:localization-checkValidate i18n setup

Python Commands (/python:)

Python backend and API development.

Code Generation

CommandDescription
/python:generate-endpoint <Name>Generate API endpoint
/python:generate-model <Name>Generate data model

Analysis Commands

CommandDescription
/python:check-architectureValidate architecture
/python:check-code-qualityRun code quality checks
/python:check-complianceCheck rule compliance
/python:check-securitySecurity audit
/python:check-testingTest coverage analysis

Type Commands

CommandDescription
/python:type-coverageAnalyze type hint coverage

Async Commands

CommandDescription
/python:async-checkValidate async/await usage

Dependency Commands

CommandDescription
/python:dependency-auditAudit dependencies for vulnerabilities

React Commands (/react:)

Frontend development with React/TypeScript.

Code Generation

CommandDescription
/react:generate-component <Name>Generate React component
/react:generate-hook <Name>Generate custom hook
/react:storybook-story <Component>Generate Storybook story

Analysis Commands

CommandDescription
/react:check-architectureValidate architecture
/react:check-code-qualityRun code quality checks
/react:check-complianceCheck rule compliance
/react:check-securitySecurity audit
/react:check-testingTest coverage analysis

Performance Commands

CommandDescription
/react:bundle-analyzeAnalyze bundle size

Accessibility Commands

CommandDescription
/react:accessibility-checkA11y validation

React Native Commands (/reactnative:)

Mobile development with React Native.

Code Generation

CommandDescription
/reactnative:generate-screen <Name>Generate screen component
/reactnative:native-module <Name>Generate native module

Analysis Commands

CommandDescription
/reactnative:check-architectureValidate architecture
/reactnative:check-code-qualityRun code quality checks
/reactnative:check-complianceCheck rule compliance
/reactnative:check-securitySecurity audit
/reactnative:check-testingTest coverage analysis

App Commands

CommandDescription
/reactnative:app-sizeAnalyze app bundle size
/reactnative:deep-link <Route>Configure deep linking
/reactnative:store-preparePrepare for app store

Angular Commands (/angular:)

Frontend development with Angular standalone components and signals.

Code Generation

CommandDescription
/angular:generate-component <Name>Generate standalone component with tests

Analysis Commands

CommandDescription
/angular:check-architectureValidate architecture (domain-driven, smart/dumb)
/angular:check-code-qualityRun code quality checks (signals, OnPush, RxJS)
/angular:check-complianceCheck rule compliance (standalone, modern syntax)
/angular:check-securitySecurity audit (XSS, CSRF, authentication)
/angular:check-testingTest coverage analysis (Vitest/Jest, Cypress)

C#/.NET Commands (/csharp:)

Backend development with C#/.NET, Clean Architecture, and CQRS.

Code Generation

CommandDescription
/csharp:generate-feature <Name>Generate complete CQRS feature (entity, commands, queries, endpoints)

Analysis Commands

CommandDescription
/csharp:check-architectureValidate Clean Architecture (layers, dependencies)
/csharp:check-code-qualityRun code quality checks (async, LINQ, null safety)
/csharp:check-complianceCheck rule compliance (CQRS, DDD, modern C#)
/csharp:check-securitySecurity audit (OWASP Top 10, injection, auth)
/csharp:check-testingTest coverage analysis (xUnit, integration tests)

Laravel Commands (/laravel:)

PHP backend development with Laravel, Clean Architecture, and Pest PHP.

Code Generation

CommandDescription
/laravel:generate-controller <Name>Generate API controller with Form Request, Resource, and Policy

Analysis Commands

CommandDescription
/laravel:check-architectureValidate Clean Architecture (layers, dependencies)
/laravel:check-code-qualityRun code quality checks (PHPStan, Pint, N+1)
/laravel:check-complianceCheck rule compliance (Actions, DTOs, modern PHP)
/laravel:check-securitySecurity audit (OWASP Top 10, Sanctum, validation)
/laravel:check-testingTest coverage analysis (Pest PHP, factories)

Vue.js Commands (/vuejs:)

Frontend development with Vue.js 3, Composition API, and TypeScript.

Code Generation

CommandDescription
/vuejs:generate-component <Name>Generate component with test, types, and Storybook story

Analysis Commands

CommandDescription
/vuejs:check-architectureValidate architecture (modules, components, stores)
/vuejs:check-code-qualityRun code quality checks (ESLint, TypeScript, Prettier)
/vuejs:check-complianceCheck rule compliance (Composition API, Pinia, modern Vue)
/vuejs:check-securitySecurity audit (XSS, CSRF, authentication)
/vuejs:check-testingTest coverage analysis (Vitest, Vue Test Utils)

PHP Commands (/php:)

Standalone PHP development with PSR-12 and PHPStan.

CommandDescription
/php:check-architectureValidate architecture (layers, dependencies)
/php:check-code-qualityRun code quality checks (PHPStan, PSR-12)
/php:check-complianceCheck rule compliance (modern PHP 8.5)
/php:check-securitySecurity audit (OWASP Top 10, injection)
/php:check-testingTest coverage analysis (Pest PHP)

Docker Commands (/docker:)

Infrastructure and containerization commands.

Setup Commands

CommandDescription
/docker:compose-setup <Services>Generate docker-compose configuration
/docker:architecture <Project>Design complete Docker architecture

Operations Commands

CommandDescription
/docker:debug <Symptom>Diagnose Docker issues
/docker:cicd-pipeline <Platform>Generate CI/CD pipeline
/docker:optimize <Target>Optimize Docker configuration

Coolify Commands (/coolify:)

Infrastructure deployment with Coolify self-hosted PaaS.

CommandDescription
/coolify:setupInitialize project for Coolify deployment
/coolify:deployDeploy application to Coolify
/coolify:debugDiagnose Coolify deployment issues
/coolify:backupConfigure and manage backups
/coolify:optimizeOptimize Coolify deployment

Kubernetes Commands (/kubernetes:)

Infrastructure orchestration with Kubernetes.

Architecture Commands

CommandDescription
/kubernetes:architecture <Project>Design complete Kubernetes architecture
/kubernetes:deploy-setup <Stack>Setup GitOps deployment pipeline

Operations Commands

CommandDescription
/kubernetes:debug <Symptom>Diagnose Kubernetes issues
/kubernetes:security-audit [Scope]Kubernetes security posture audit
/kubernetes:optimize [Target]Optimize Kubernetes resource usage and costs

OpenTofu Commands (/opentofu:)

Infrastructure as Code with OpenTofu.

Architecture Commands

CommandDescription
/opentofu:architecture <Project>Design complete OpenTofu IaC architecture
/opentofu:deploy-setup <Platform>Setup CI/CD pipeline for OpenTofu

Operations Commands

CommandDescription
/opentofu:debug <Symptom>Diagnose OpenTofu state issues and drift
/opentofu:security-audit [Scope]Audit OpenTofu security posture
/opentofu:optimize [Target]Cost optimization and resource analysis

Ansible Commands (/ansible:)

Infrastructure automation with Ansible.

Architecture Commands

CommandDescription
/ansible:architecture <Project>Design complete Ansible automation architecture
/ansible:deploy-setup <Platform>Setup CI/CD pipeline for Ansible

Operations Commands

CommandDescription
/ansible:debug <Symptom>Diagnose Ansible playbook issues
/ansible:security-audit [Scope]Audit Ansible security posture
/ansible:optimize [Target]Optimize Ansible performance and quality

Hcloud Commands (/hcloud:)

Hetzner Cloud infrastructure management with hcloud CLI.

Architecture Commands

CommandDescription
/hcloud:architecture <Project>Design complete Hetzner Cloud infrastructure architecture
/hcloud:deploy-setup <Platform>Setup CI/CD pipeline for Hetzner Cloud deployments

Operations Commands

CommandDescription
/hcloud:debug <Symptom>Diagnose Hetzner Cloud infrastructure issues
/hcloud:security-audit [Scope]Audit Hetzner Cloud security posture
/hcloud:optimize [Target]Optimize Hetzner Cloud cost and performance

PgBouncer Commands (/pgbouncer:)

PgBouncer connection pooling management.

Architecture Commands

CommandDescription
/pgbouncer:architecture <Project>Design complete PgBouncer connection pooling architecture
/pgbouncer:deploy-setup <Platform>Setup PgBouncer deployment with Docker, Kubernetes, or systemd

Operations Commands

CommandDescription
/pgbouncer:debug <Symptom>Diagnose PgBouncer connection pool issues from symptoms
/pgbouncer:security-audit [Scope]Audit PgBouncer security posture
/pgbouncer:optimize [Target]Optimize PgBouncer pool performance and connection utilization

FrankenPHP Commands (/frankenphp:)

FrankenPHP PHP application server management.

Architecture Commands

CommandDescription
/frankenphp:architecture <Project>Design complete FrankenPHP serving architecture
/frankenphp:deploy-setup <Platform>Generate FrankenPHP deployment files for Docker, Kubernetes, or standalone

Operations Commands

CommandDescription
/frankenphp:debug <Symptom>Diagnose FrankenPHP worker and Caddyfile issues from symptoms
/frankenphp:security-audit [Scope]Audit FrankenPHP security posture
/frankenphp:optimize [Target]Optimize FrankenPHP worker performance and throughput

Project Commands (/project:)

Available with Project installation.

CommandDescription
/project:generate-backlog <Feature>Generate backlog
/project:decompose-tasks <Epic>Break down epic into tasks
/project:add-epic <Name>Create a new EPIC
/project:add-story <Epic> <Name>Create a User Story
/project:add-task <US> <Desc> <Est>Create a task
/project:list-epicsList all EPICs
/project:list-storiesList User Stories
/project:list-tasksList tasks
/project:move-task <Task> <Status>Change task status
/project:boardDisplay Kanban board
/sprint:statusShow sprint metrics
/project:update-epic <Epic>Update an EPIC
/project:update-story <US>Update a User Story
/sprint:dev <N|next>Start TDD/BDD sprint development

BMAD v6 Commands (NEW)

CommandDescription
/project:analyze-backlogAnalyze current backlog structure
/project:migrate-backlogConvert backlog to BMAD v6 format
/project:update-storiesAdd missing BMAD fields to stories
/project:sync-backlogSynchronize backlog files ↔ YAML
/project:generate-prdGenerate Product Requirements Document
/project:generate-tech-specGenerate Technical Specification
/project:run-epic <ID>Queue all stories in an epic
/project:run-queueProcess queued stories
/project:run-sprintExecute full sprint
/project:batch-statusView batch queue status

SDD v2.0 Commands (NEW)

CommandDescription
/project:generate-constitutionGenerate project constitution document
/project:trace [--scope] [--id]Display bidirectional traceability matrix
/project:coverage-mapAnalyze requirement coverage gaps
/project:scan [--scope]Analyze codebase and generate structured inventory
/project:reverse-prdGenerate PRD from existing codebase (brownfield)
/project:reverse-storiesGenerate user stories from existing features
/project:gap-analysisCompare specifications with actual code
/project:checkpoint --phase=<phase>Run spec verification checkpoints (pre-sprint, pre-impl, post-impl, pre-merge)
/project:dependencies [--sprint]Generate story dependency graph (Mermaid)
/project:critical-path [--sprint]Identify critical path for sprint optimization
/project:metrics [--sprint]Generate project metrics dashboard
/project:burndown [--sprint]Generate sprint burndown chart (Mermaid)

Sprint Development (/sprint:dev)

Orchestrates complete sprint development in TDD/BDD mode:

bash
/sprint:dev 1        # Sprint 1
/sprint:dev next     # Next incomplete sprint
/sprint:dev current  # Currently active sprint

Features:

  • Mandatory plan mode before each task implementation
  • TDD cycle (RED → GREEN → REFACTOR)
  • Automatic status updates (Task → User Story → Sprint)
  • Progress tracking with metrics

Workflow:

  1. Load sprint and display board
  2. For each User Story (by priority):
    • Mark US → In Progress
    • Display acceptance criteria (Gherkin)
  3. For each Task (by type: DB → BE → FE → TEST → DOC → REV):
    • Plan Mode (mandatory): Analyze code, propose implementation
    • TDD Cycle: Write failing tests → Implement → Refactor
    • Definition of Done check
    • Mark Task → Done with time tracking
    • Conventional commit
  4. When all tasks done → Mark US → Done
  5. When all US done → Generate sprint review/retro

Control commands during execution:

CommandAction
continueValidate plan and implement
skipSkip this task
block [reason]Mark as blocked
stopStop (saves state)

Sprint Management Commands (/sprint:)

Available with BMAD v6 installation.

CommandDescription
/sprint:next-storyGet next ready-for-dev story
/sprint:transition <ID> <status>Transition story status
/sprint:auto-routeExecute automatic routing rules

State Machine

Stories flow through these statuses:

backlog → ready-for-dev → in-progress → review → done
    ↓         ↓              ↓           ↓
    └─────────┴──────────────┴───────────┴→ blocked

TDD Phase Tracking:

  • 🔴 red - Writing failing tests
  • 🟢 green - Implementing to pass
  • 🔵 refactor - Cleaning up code

Quality Gate Commands (/gate:)

Available with BMAD v6 installation.

CommandDescription
/gate:validate-prdValidate PRD (≥80% threshold)
/gate:validate-techspecValidate Tech Spec (≥90% threshold)
/gate:validate-backlogValidate INVEST compliance
/gate:validate-story <ID>Validate story Definition of Done
/gate:validate-sprintValidate sprint readiness
/gate:reportFull quality gates report
/gate:validate-alignment [story-id]Validate spec-code alignment (≥85% threshold)

Quality Gate Thresholds

GateThresholdCriteria
PRD Gate≥80%Problem, users, goals, metrics, scope
Tech Spec Gate≥90%Architecture, security, testing, deployment
Backlog Gate6/6 INVESTIndependent, Negotiable, Valuable, Estimable, Small, Testable
Story DoD100%Tasks, tests, AC, review, no blockers
Sprint Ready100%Metadata, goal, stories ready, estimated
Spec Alignment≥85%Requirement coverage, story-code mapping, AC-test mapping, constitution

QA Recette Commands (/common:) - NEW

Automated acceptance testing with Claude in Chrome.

CommandDescription
/qa:recetteExecute automated acceptance tests via browser
/qa:fixFix bugs from recette session (TDD workflow)
/qa:statusShow recette session status and progress
/qa:regressionView and manage regression test registry
/qa:reportGenerate recette report (MD/HTML/JSON)

Golden Rule

A fixed bug should NEVER reappear.

All detected errors automatically generate regression tests.

Usage Examples

bash
# Test a specific story
/qa:recette --scope=story --id=US-001

# Test all stories in a sprint
/qa:recette --scope=sprint --id=Sprint-3

# Dry run to see test plan
/qa:recette --scope=story --id=US-001 --dry-run

# Resume interrupted session
/qa:recette --resume=REC-20260130-143022

# Record execution as GIF
/qa:recette --scope=story --id=US-001 --record-gif

# Fix all bugs from a recette session
/qa:fix --session=REC-20260130-143022

# Dry run: refine and document without fixing
/qa:fix --session=REC-20260130-143022 --dry-run

# Fix critical bugs only
/qa:fix --session=REC-20260130-143022 --severity=critical

Prerequisites

  • Chrome extension Claude in Chrome v1.0.36+
  • Claude Code with --chrome flag or /chrome command

Test Categories

CategoryDescription
acceptance_criteria_validationTests for each AC
edge_casesBoundary conditions
error_scenariosError handling
ui_ux_verificationUI/UX consistency
performance_checksLoad times
security_basicsXSS, CSRF, injection

Error → Test Pipeline

When an error is detected:

  1. Classify error type (visual, interaction, validation, logic, security, API)
  2. Generate appropriate tests:
    • Logic/Validation → Unit test
    • API/Service → Functional test
    • User flow → Behat feature
  3. Register in regression suite with @regression tag
  4. Fix bug using TDD workflow
  5. Verify all regression tests pass

Output Structure

.recette/
├── plans/           # Test plans (YAML)
├── sessions/        # Session states (resume)
├── regression/      # Regression tests
│   └── registry.yaml
├── metrics/         # Historical data
└── reports/         # Generated reports

See command documentation: Dev/i18n/{lang}/Common/commands/recette.md See fix command documentation: Dev/i18n/{lang}/Common/commands/recette-fix.md See status command documentation: Dev/i18n/{lang}/Common/commands/recette-status.md See regression command documentation: Dev/i18n/{lang}/Common/commands/recette-regression.md See report command documentation: Dev/i18n/{lang}/Common/commands/recette-report.md


Command Output Formats

Commands typically output in structured formats:

Audit Commands

══════════════════════════════════════════════════════════════
AUDIT REPORT
══════════════════════════════════════════════════════════════

[ ] Issue 1
[x] Check passed
[ ] Issue 2

Summary: 2 issues found

Generation Commands

Generated files:
- src/Component/NewComponent.tsx
- src/Component/NewComponent.test.tsx
- src/Component/NewComponent.stories.tsx

Check Commands

Architecture Check
──────────────────────────────────────────────────────────────
✓ Layer separation: PASS
✗ Dependency direction: FAIL
  - Infrastructure depends on Domain (src/Infra/Service.php:15)

Score: 85/100

Command Frontmatter Format

All commands include YAML frontmatter for Claude Code discovery:

markdown
---
description: Brief description of what the command does
argument-hint: <required-arg> [optional-arg]
---

# Command Title

Command content...

Frontmatter Fields

FieldRequiredDescription
descriptionYesBrief description shown in command list
argument-hintNoShows expected arguments format

Examples

Command with arguments:

markdown
---
description: Generate CRUD operations for an entity with Clean Architecture
argument-hint: <EntityName>
---

# Generate CRUD

Generate complete CRUD operations for $ARGUMENTS...

Command without arguments:

markdown
---
description: Run all pre-commit checks (tests, lint, security)
---

# Pre-Commit Check

Execute all validation checks before committing...

Variable Substitution

Commands can use these variables:

VariableDescription
$ARGUMENTSAll arguments passed after command name
$ARG1, $ARG2...Individual positional arguments

Creating Custom Commands

Add markdown files to .claude/commands/{namespace}/:

markdown
---
description: What this command does
argument-hint: <arg1> [arg2]
---

# My Custom Command

Description of what this command does.

## Arguments
$ARGUMENTS

## Process

### Step 1
What to do first...

### Step 2
What to do next...

## Output
Expected output format...

Place in:

  • .claude/commands/common/ for /common: namespace
  • .claude/commands/myproject/ for /myproject: namespace

Context Management Best Practices

Effective context management is the #1 productivity factor with Claude Code (source: Anthropic).

Key Principles

PrincipleAction
Context is finiteMonitor context % in status line
Use /clearBetween unrelated tasks
Delegate investigationsUse sub-agents (Task tool) for exploration
Verification loopsAlways provide tests/expected outputs
Plan before actingUse Plan Mode for complex tasks (> 3 files)
Parallel worktreesgit worktree add for concurrent sessions

CLAUDE.md Size

Keep your main CLAUDE.md under 200 lines. Each additional instruction dilutes attention on existing ones. Use .claude/rules/ for detailed guidelines.

Hooks vs Instructions

MechanismStrengthUse When
CLAUDE.mdSuggestionGuidelines, conventions
Rules (.claude/rules/)Strong suggestionDetailed best practices
HooksEnforcementSecurity constraints, formatting

See .claude/templates/hooks/ for ready-to-use hook templates.

Context Thresholds

Context %Recommended Action
< 30%Normal operation
30-60%Monitor, avoid unnecessary file reads
60-80%Delegate to sub-agents, consider /clear
> 80%Compaction imminent, save critical context

See rule 12-context-management.md for full documentation.


Best Practices

  1. Use check commands before commits
  2. Generate with commands for consistent code
  3. Audit regularly with team-audit
  4. Document decisions with architecture-decision
  5. Track sprints with sprint commands
  6. Manage context — use /clear between tasks, delegate investigations
  7. Use hooks for security enforcement (not just CLAUDE.md instructions)