Systematic debugging plugin for Claude Code. Investigates hard-to-diagnose bugs by generating multiple root-cause hypotheses and exploring them concurrently via autonomous agents.
/debugging-workflow:parallel-debug— Orchestrates the full parallel debug session: session setup, git worktree isolation, agent spawning, arbitration gating, fix application, and cleanuphypothesis-investigatoragent — Autonomous per-hypothesis agent: works in an isolated git worktree, writes a failing test, applies a targeted fix, iterates until the test passes, and emits a structured YAML reporthypothesis-arbitratoragent — Conflict-resolution agent invoked only when two or more investigators both pass. Re-verifies evidence citations, checks for fix-diff overlap, and returnsONE_WINNER,MERGE_FIXES, orESCALATE_TO_USER- Preflight check — Runs the project's install step and full test suite once, before any worktree is created, to catch a broken or too-slow test environment before it gets multiplied by
hypothesis_count - Degraded mode — Optional single-worktree, sequential-hypothesis execution path for low-resource machines
Use parallel-debug when:
- The root cause is genuinely unclear (multiple plausible theories coexist)
- The bug is intermittent or hard to reproduce consistently
- A previous debug pass was inconclusive
- Time pressure demands concurrent investigation over sequential elimination
Skip parallel-debug when the orchestration overhead outweighs the benefit:
- The bug is simple. A single plausible cause, an obvious typo, or a stack trace that points directly at the fix. Spinning up 2–4 worktrees for something already explainable is pure overhead — investigate it directly.
- The project has a heavy test environment. Docker Compose stacks, database migrations, browser/E2E
suites, or multi-minute builds. Every worktree installs dependencies and runs tests independently, so a slow
suite gets multiplied by
hypothesis_count, not divided. Step 0's preflight check exists for exactly this case — if it trips (install failure, timeout, or an environment error), take the manual path instead. On a genuinely resource-constrained machine that still wants to use the workflow,degraded_mode(below) removes most of the multiplication instead of removing the workflow entirely. - The deadline is tight and closing fast. Session setup, worktree creation, dependency installs, and agent spin-up all happen before the first piece of evidence comes back. A human with a strong existing suspicion will usually beat this workflow on wall-clock time for a single fix.
- This is a production incident.
parallel-debugis a development-phase tool, on purpose. It creates local git worktrees and branches, applies fixes viagit apply, and assumes a normal dev working tree — it was never designed to touch a production environment or a live incident, and that's an intentional scope limit, not a gap. For an active incident, investigate and patch directly.
# Add this repo as a marketplace source
/plugin marketplace add sembraniteam/claude-plugins
# Install the plugin
/plugin install debugging-workflow@sembraniteam-claude-plugins# Clone the repo
git clone https://github.com/sembraniteam/claude-plugins.git
# Add the local repo as a marketplace
/plugin marketplace add /path/to/claude-plugins
# Install
/plugin install debugging-workflow@sembraniteam-claude-plugins/debugging-workflow:parallel-debug TypeError: Cannot read properties of undefined at auth.ts:87
/debugging-workflow:parallel-debug My login flow is broken on staging but works locally
Claude will generate hypotheses, spawn parallel investigation agents, and return a ranked evidence report.
Create .claude/debugging-workflow.local.md in your project root to customize behavior:
---
max_parallel_agents: 4
time_budget_minutes: 5
hypothesis_count: 3
preflight_max_minutes: 5
degraded_mode: false
---| Field | Type | Default | Description |
|---|---|---|---|
max_parallel_agents |
integer | 4 |
Maximum number of hypothesis agents to spawn concurrently (2–5). Ignored when degraded_mode: true. |
time_budget_minutes |
integer | 5 |
Approximate time budget per agent, in minutes (agents run in parallel, so this is not a total). See references/report-format.md for the exact minutes-to-iterations table. |
hypothesis_count |
integer | 3 |
Number of hypotheses to generate (2–4). No hard constraint against max_parallel_agents: if it exceeds that cap, investigators run in sequential batches (see "Spawn investigators" below). |
preflight_max_minutes |
integer | 5 |
Wall-clock cap for the Step 0 preflight test run. If the suite doesn't finish within this window, the session stops before creating any worktree. See references/resource-constraints.md. |
degraded_mode |
boolean | false |
When true, uses a single shared worktree and investigates hypotheses strictly sequentially instead of one worktree per hypothesis — for low-resource machines. See references/resource-constraints.md. |
A template is at skills/parallel-debug/examples/debugging-workflow.local.md.
This file should not be committed — it's already in
.gitignorevia.claude/*.local.md.
- Session setup — Create
.claude/debug-sessions/{id}/(add this path to your project's.gitignore— it's untracked working state, not source), verify clean working tree (tracked files only), record base SHA - Preflight check — Run the project's install step and full test suite once on the current branch, capped at
preflight_max_minutes; stop before creating any worktree if it fails to install, times out, or the test runner errors out (an ordinary test failure is not a stop condition) - Generate hypotheses — Produce 2–4 distinct, falsifiable hypotheses using the error message and hypothesis catalog
- Create worktree(s) — Standard mode: each hypothesis gets an isolated git worktree and branch. Degraded mode (
degraded_mode: true): a single shared worktree is created once and reused - Spawn investigators — Standard mode:
hypothesis-investigatoragents launch in batches of at mostmax_parallel_agents(all at once whenhypothesis_countfits within that cap, sequential batches otherwise). Degraded mode: agents launch strictly one at a time in the shared worktree, which is reset to a clean state between each. Either way, each installs project dependencies, writes a failing test, applies a fix, captures fix + test together as a diff (never commits), and writes a YAML report to{id}/hN.report.yaml(outside the worktree, so it survives cleanup) - Gate arbitration — If exactly one hypothesis passes, apply directly; if multiple pass, invoke
hypothesis-arbitrator - Apply fix — Apply the winning fix diff(s) onto the original branch with
git applyand re-run tests - Cleanup — Remove all worktree(s) and branch(es); the
hN.report.yamlfiles remain on disk for audit since they were never inside the deleted worktree(s)
debugging-workflow/
├── .claude-plugin/
│ └── plugin.json
├── skills/
│ └── parallel-debug/
│ ├── SKILL.md # Orchestration workflow
│ ├── examples/
│ │ └── debugging-workflow.local.md # Settings template
│ └── references/
│ ├── hypothesis-catalog.md # Hypothesis library by symptom
│ ├── report-format.md # Evidence report spec and ranking algorithm
│ ├── apply-verification.md # Rationale behind Step 5 artifact-verification checks
│ └── resource-constraints.md # Preflight check and degraded_mode mechanics
├── agents/
│ ├── hypothesis-investigator.md # Per-hypothesis: test → fix → YAML report
│ └── hypothesis-arbitrator.md # Conflict resolution when multiple fixes pass
└── README.md