> ## Documentation Index
> Fetch the complete documentation index at: https://ai-development-environment.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Command run

> Watch a command's terminal output, attempts, and immutable snapshot.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/ai-development-environment/aldo79nFpNgOg3HT/images/light/command-run.png?fit=max&auto=format&n=aldo79nFpNgOg3HT&q=85&s=3f65ec029fa65032c0ce560e83c05d6d" alt="Command run page in light theme" width="3840" height="2160" data-path="images/light/command-run.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/ai-development-environment/aldo79nFpNgOg3HT/images/dark/command-run.png?fit=max&auto=format&n=aldo79nFpNgOg3HT&q=85&s=22a771ac673a17d45d9bf9e4c42deedf" alt="Command run page in dark theme" width="3840" height="2160" data-path="images/dark/command-run.png" />
</Frame>

The command run page at `/commands/runs/{id}` shows one execution end to end: where it ran, what it printed, how many attempts it took, and exactly what script was executed.

## Header

The run number and status badge, with **Rerun** and — while the run is active — **Terminate**.

**Rerun** starts a new run from *this run's snapshot*, and links the two together as predecessor and successor so you can walk a chain of retries.

## Overview

| Field                | Notes                                                                               |
| -------------------- | ----------------------------------------------------------------------------------- |
| Status               | Queued, Running, Restarting, Cancelling, Succeeded, Failed, Cancelled, or Timed out |
| Origin               | Manual, Quick action, Workflow, or Rerun                                            |
| Agent                | Name and hostname of the Mac it ran on                                              |
| Worktree             | Folder and branch, for worktree-scoped commands                                     |
| Exit code and signal | How the last attempt ended                                                          |
| Error                | The failure message, when there is one                                              |
| Next restart         | When a restarting run will try again                                                |

## Terminal output

Output streams in live and is retained with the run.

| Control             | Effect                                              |
| ------------------- | --------------------------------------------------- |
| **Follow output**   | Keeps the view pinned to the newest line            |
| **Search terminal** | Finds text, with previous and next match navigation |
| **Fit terminal**    | Refits the terminal to the available width          |
| **View raw output** | Opens the unstyled log                              |

When a run restarts, output is divided by **Attempt** markers so you can see where each attempt began and what exit code ended it.

## Why a queued run has not started

While a run waits, the page shows **Waiting to start** with the current reason. It refreshes the explanation as the agent and competing runs change.

| Reason                  | Meaning                                                                      |
| ----------------------- | ---------------------------------------------------------------------------- |
| Waiting for agent       | The job was handed to the agent but has not been picked up                   |
| Agent offline           | The selected agent must reconnect before the run can start                   |
| Waiting for predecessor | A **Restart** or **Rerun** successor waits for the run it replaces to finish |
| Restart delay           | The next attempt is waiting for the restart delay                            |
| Target busy             | One or more active runs hold the target                                      |
| Queued behind           | A blocking run is ahead of this run in the target's queue                    |
| Ready                   | Nothing blocks the run; it starts on the next dispatch                       |

The **Queue** table shows every command run competing for the target. Target holders appear first, followed by waiting runs in queue order. Each row includes the run number, name, status, concurrency mode, and queued time. Badges identify **This run**, **Holds the target**, and the exact runs that are **Blocking** it. Select another run number to open it.

<Note>
  Excluded runs do not participate in this command queue. A queued worktree command may also be waiting for an active Git or worktree operation on its codebase.
</Note>

## Attempts

Every attempt with its number, status, exit code, signal, error, and start and finish times. A run with a restart policy accumulates one row per attempt; a run that never restarts has exactly one.

## Timing

Queued, started, and finished timestamps, plus total duration.

## Immutable command snapshot

The name, description, script, target kind, concurrency mode, Git-blocking setting, restart policy, restart limit, and notification setting captured when the run started, with **Copy** for the script.

<Note>
  This snapshot is why history stays trustworthy. Editing or deleting the command definition later does not change what this page reports — it shows what actually ran.
</Note>

## Restart behavior

<AccordionGroup>
  <Accordion title="When a restart happens" icon="repeat">
    Under **On failure**, a restart follows any attempt that exited non-zero or was killed by a signal. Under **Always**, every exit restarts. A manual **Terminate** never restarts, whatever the policy says.

    Restarts are scheduled a second after the previous attempt exits, and the run sits in **Restarting** in the meantime.
  </Accordion>

  <Accordion title="How the limit is counted" icon="hashtag">
    The failed restart limit caps a *burst* of quick failures. An attempt that ran for at least one minute resets the counter to zero before its exit is evaluated, so a long-lived process that dies after hours starts again with a full budget. A script that fails instantly, repeatedly, exhausts the limit and the run is marked **Failed**.

    With no limit set, restarts are unlimited.
  </Accordion>
</AccordionGroup>

## Related pages

<Columns cols={2}>
  <Card title="Commands" icon="terminal" href="/commands/commands">
    All runs and definitions, with bulk archive and delete.
  </Card>

  <Card title="Job details" icon="scroll" href="/agents/job-detail">
    The underlying durable agent job each attempt executes as.
  </Card>
</Columns>
