Skip to content
Development
Command

/debug

Systematically debug an issue by analyzing symptoms, forming hypotheses, and testing them.

From plugin
rohitg00-claude-code-toolkit
2.5k199 skills138 agents199 commands
Install
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/debug

Context preview

What this command does when you run it.

Systematically debug an issue by analyzing symptoms, forming hypotheses, and testing them.

Command definition

debug.md

Systematically debug an issue by analyzing symptoms, forming hypotheses, and testing them.

Steps

1. Gather the bug report: error message, stack trace, reproduction steps, expected vs actual behavior. 2. Identify the entry point where the issue manifests (endpoint, UI action, CLI command). 3. Trace the execution path from entry to error:

  • Read the code path that handles the triggering action.
  • Check for recent changes in the affected files: `git log --oneline -10 -- <file>`.
  • Look for related error handling or edge cases.

4. Form hypotheses ranked by likelihood:

  • Data issue: unexpected null, wrong type, missing field.
  • Logic error: incorrect condition, off-by-one, wrong operator.
  • State issue: race condition, stale cache, missing initialization.
  • Environment: missing config, version mismatch, network failure.

5. Test each hypothesis:

  • Add targeted logging or breakpoints.
  • Write a minimal reproduction test case.
  • Check edge cases around the failure point.

6. Implement the fix and verify it resolves the issue. 7. Add a regression test that would catch the bug if reintroduced.

Format

Bug: <description>
Root Cause: <what actually went wrong>
Fix: <what was changed>
Files: <list of modified files>
Test: <regression test added>

Rules

  • Start with the simplest hypothesis before investigating complex causes.
  • Never fix a bug without understanding the root cause.
  • Always add a regression test for the fix.
  • Check if the same bug pattern exists elsewhere in the codebase.
Read more
Ships withrohitg00-claude-code-toolkit

The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.

Get the whole plugin