---
title: debug
description: Reproduce and fix a reported bug with validation.
---

`debug` reuses the same `ValidationLoop` component as `implement`, but with a bug-focused default prompt. Unlike `implement`, `debug` does not pass early-exit (`done`) or prior-attempt feedback to the loop, so it runs all iterations (up to `maxIterations` = 3) rather than stopping as soon as validation passes and a reviewer approves.

```bash
bunx smithers-orchestrator workflow run debug --prompt "Fix the intermittent gateway reconnect failure"
```

<Frame caption="The debug UI shows the reproduce → fix → validate iterations, with no early exit until the fix is verified.">
  <img src="/images/workflow-ui/debug.png" alt="debug workflow UI showing reproduce, fix, and validation iterations" />
</Frame>

## Inputs

| Input | Type | Default |
| --- | --- | --- |
| `prompt` | string | `"Reproduce and fix the reported bug."` |

## How It Runs

1. Attempts to understand and reproduce the bug.
2. Applies a targeted fix.
3. Validates the result.
4. Reviews the fix and re-runs the implement/validate/review cycle using `ValidationLoop` for a fixed number of iterations (up to 3). Unlike `implement`, `debug` does not stop early when validation passes; it runs all iterations and returns the last attempt.

After the fix is applied, run `improve-test-coverage` to add a regression test, then `review` to confirm the change is production-ready.

## Output Shape

`debug` commits changes directly to the working tree. The run log records each iteration's validation result and reviewer feedback; the last iteration's output is the final result.

## Use it when

- A reported bug needs reproduction, a fix, and validation.
- You want every iteration to run rather than stopping at the first green check.

## Use something else when

- You already know the fix and just want it applied and reviewed: use [`implement`](/workflows/implement).
- You need a regression test for the fix: follow with [`improve-test-coverage`](/workflows/improve-test-coverage).

## Resume & retry

Runs are durable and resume with `up --resume`. Unlike `implement`, `debug` does not stop early; it runs all iterations (up to 3) and returns the last attempt.
