一键导入
debug
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes — multi-agent competing hypotheses debugging
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes — multi-agent competing hypotheses debugging
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when the user wants to do a QA session or report multiple bugs — interactive session where bugs are reported conversationally and agents fix them in parallel
Use when executing implementation plans with independent tasks — orchestration pattern for worktree isolation, TDD discipline, and two-stage review. Referenced by execute-plan, fixit, and bugbash.
Use when the user reports a bug or issue that can be fixed without blocking their current work — backgrounds an agent in a worktree to fix and merge back without breaking stride
Use after implementing changes in an OpenSpec project to review implementation against the active change's deltas — auto-fixes confident issues, parks questions for the user
Install the anutron (claude-skills) kit into the current project — symlinks or copies skills, registers hooks, compiles CLAUDE.md from snippets.
Uninstall the anutron (claude-skills) kit from the current project — reverses everything /anutron-install did.
| name | debug |
| description | Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes — multi-agent competing hypotheses debugging |
| tags | ["quality"] |
Spawn multiple investigators to debug a problem in parallel. Each pursues a different theory and they argue with each other to converge on the root cause.
Agent teams must be enabled in Claude Code settings:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
If agent teams are not enabled, report: "Agent teams required. Add CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 to your Claude Code settings (env section)." and stop.
$ARGUMENTS - Required: description of the bug, failing test, error message, or unexpected behaviorIf no arguments are provided, ask the user what they're debugging.
git branch --show-current 2>/dev/null || echo '(not in a git repo)'git status --short 2>/dev/null || echo '(not in a git repo)'pwdfind . -maxdepth 1 \( -name go.mod -o -name Gemfile -o -name package.json -o -name Cargo.toml -o -name pyproject.toml -o -name setup.py -o -name requirements.txt -o -name pom.xml -o -name build.gradle -o -name Makefile \) 2>/dev/null | head -5git log --oneline -10 2>/dev/null || echo '(not in a git repo)'find . -maxdepth 4 -name "*_test.*" -o -name "*.test.*" -o -name "*_spec.*" 2>/dev/null | head -10You are the lead investigator coordinating a debugging team. Your job is to formulate hypotheses, assign them to investigators, moderate the debate, and produce a root cause analysis.
Problem to debug: $ARGUMENTS
You do NOT investigate yourself. You formulate hypotheses, assign them, moderate debate, and synthesize findings.
Why this works: A single agent investigating a bug tends to anchor on the first plausible explanation. Multiple agents pursuing different theories in parallel, then actively trying to disprove each other, surface the actual root cause faster.
Clean working tree: If there are uncommitted changes, do not silently commit them. Stash so the tree is clean for bisecting and the user's work is preserved: git stash push -u -m "pre-debug-session" (restore with git stash pop after the session).
Analyze the problem from $ARGUMENTS and the context above.
Formulate 3 hypotheses for what might be causing the bug. Each hypothesis should be:
Present the hypotheses to the user before proceeding.
Create the team (clean up stale session first if needed):
TeamDelete() -- ignore if no existing team
TeamCreate(team_name: "debug-session", description: "Debug: {brief problem summary}")
Create the task list with TaskCreate:
Spawn 3 investigators in a single message with 3 Task tool calls. Use the agent briefing below. Use model: "sonnet" for all investigators.
Send each investigator their assignment via SendMessage:
PROBLEM: {full problem description from $ARGUMENTS}
YOUR HYPOTHESIS: {the specific hypothesis assigned to this investigator}
OTHER HYPOTHESES BEING INVESTIGATED:
- investigator-1: {hypothesis 1}
- investigator-2: {hypothesis 2}
- investigator-3: {hypothesis 3}
INSTRUCTIONS:
1. Explore the codebase to gather evidence FOR your hypothesis.
2. Also look for evidence AGAINST your hypothesis -- be honest.
3. Try to reproduce the bug if possible.
4. Check git history for recent changes related to your hypothesis.
5. When you have findings, share them with ALL other investigators:
- Message each investigator directly with your evidence.
- Explain what you found and how it supports or undermines your theory.
6. Read and respond to other investigators' findings:
- If their evidence contradicts your hypothesis, acknowledge it.
- If you can poke holes in their theory, do so with evidence.
- If you become convinced another hypothesis is correct, say so.
After investigation and debate, message me (the lead) with:
- Your verdict: CONFIRMED, DISPROVED, or INCONCLUSIVE
- Key evidence (file paths, line numbers, reproduction steps)
- Whether you now support a different hypothesis
Mark your task as completed.
Wait for all investigators to report. Allow time for peer debate -- don't rush this phase.
Collect all reports and assess:
IF investigators converged on a single root cause:
→ Proceed to Phase 3 with that cause
IF two or more theories remain plausible:
→ Send a tiebreaker prompt (see below)
IF all hypotheses disproved:
→ Formulate new hypotheses based on evidence gathered, return to Phase 1
(max 2 total rounds)
We have competing theories. Let's settle this.
REMAINING HYPOTHESES:
{list the hypotheses still standing with evidence for each}
INSTRUCTIONS:
1. Design a SPECIFIC test that would distinguish between these theories.
(e.g., "If hypothesis A is correct, then X should happen when we do Y.
If hypothesis B is correct, Z should happen instead.")
2. Run that test or trace through the code to determine the outcome.
3. Share your results with all other investigators.
4. Message me with your final verdict.
Wait for convergence.
Once the root cause is identified:
Create fix tasks:
Send fix request to the assigned investigator:
ROOT CAUSE CONFIRMED: {description}
Implement a fix. Keep it minimal -- fix the bug, nothing more.
Run any related tests to verify.
When done, message me with your changes. Do not commit — the fix is committed only after the user reviews and approves it.
{investigator name} is implementing a fix for: {root cause}
Once they finish, review their fix:
- Does it actually address the root cause?
- Could it introduce new issues?
- Run the relevant tests to confirm.
Message me with your verification results.
{investigator name} is implementing a fix for: {root cause}
Once they finish, check for broader regressions:
- Run the full test suite (not just the targeted tests).
- Look for any code that depends on the behavior being changed.
- Check if similar patterns exist elsewhere that might have the same bug.
Message me with your regression analysis.
Wait for all three to complete.
Shut down all investigators:
For each investigator:
SendMessage(type: "shutdown_request", recipient: {name}, content: "Investigation complete.")
Wait for confirmations.
Clean up the team with TeamDelete.
Produce the investigation report:
## Debug Report
### Problem
{original problem description}
### Root Cause
{1-2 sentences explaining the root cause}
### Investigation
| Hypothesis | Investigator | Verdict | Key Evidence |
|------------|-------------|---------|--------------|
| {hypothesis 1} | investigator-1 | CONFIRMED / DISPROVED | {1-line} |
| {hypothesis 2} | investigator-2 | CONFIRMED / DISPROVED | {1-line} |
| {hypothesis 3} | investigator-3 | CONFIRMED / DISPROVED | {1-line} |
### How It Was Found
{Brief narrative of how the team converged: which evidence was decisive, what disproved the wrong theories}
### Fix Applied
| File | Change | Description |
|------|--------|-------------|
| path/to/file | modified | brief description |
### Verification
- **Tests pass:** YES / NO
- **Verified by:** {investigator name}
- **Regression check:** {investigator name} -- {result}
- **Regression risk:** {low/medium/high with explanation}
### Diff
{git diff --stat output}
When spawning investigators in Phase 0, use this prompt for all 3:
You are an INVESTIGATOR on a debugging team. You find root causes.
YOUR TEAMMATES:
- Lead: assigns hypotheses, moderates debate, synthesizes findings.
- Other investigators: pursuing different theories. You DEBATE with them.
YOUR APPROACH:
1. Gather evidence for AND against your hypothesis.
2. Share findings with other investigators via direct messages.
3. Challenge their theories with evidence. Accept challenges to yours.
4. If your theory is disproved, pivot -- help validate or disprove others.
5. Be specific: cite file paths, line numbers, and reproduction steps.
6. If you find the root cause, you may be asked to implement a fix, verify a fix, or check for regressions.
The goal is TRUTH, not winning. Abandon your hypothesis the moment
evidence disproves it.
Always use TaskUpdate to mark tasks completed.
| Failure | Action |
|---|---|
| Agent fails to spawn | Retry once. Proceed with 2 investigators if needed. |
| All hypotheses disproved (round 1) | Formulate new hypotheses based on gathered evidence. Run a second round. |
| All hypotheses disproved (round 2) | Produce report with evidence gathered. Suggest next steps for manual investigation. |
| Investigators can't converge | Lead makes a judgment call based on evidence weight. Note uncertainty in report. |
| Bug can't be reproduced | Document the investigation and evidence. Note reproduction difficulty in report. |
| Team creation fails (teams not enabled) | Report the prerequisite and stop. |