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

> Pause, resume, and cancel a W&B Sweep with the CLI.

# Manage sweeps

Use the [W\&B CLI](/models/ref/cli/wandb-sweep) to pause, resume, and cancel a sweep. The CLI's `sweep` command uses flags such as `--pause` and `--resume` to control the sweep's ability to create new W\&B runs, with different effects on existing runs:

* `--pause`: When you pause a sweep, the agent creates no new runs until you resume the sweep. Existing runs continue to execute normally.
* `--resume`: When you resume a sweep, the agent continues creating new runs according to the search strategy.
* `--stop`: When you stop a sweep, the agent stops creating new runs. Existing runs continue to completion.
* `--cancel`: When you cancel a sweep, the agent immediately kills all currently executing runs and stops creating new runs.

Use the following guidance to pause, resume, and cancel a sweep. In each case, provide the sweep ID that was generated when you initialized a sweep.

### Pause a sweep

Pause a sweep so it temporarily stops creating new runs. Runs that are already executing will continue to run until completion. Use the [`wandb sweep --pause`](/models/ref/cli/wandb-sweep) command to pause a sweep. Provide the sweep ID that you want to pause.

```bash theme={null}
wandb sweep --pause entity/project/sweep_ID
```

### Resume a sweep

Resume a paused sweep with the [`wandb sweep --resume`](/models/ref/cli/wandb-sweep) command. The sweep will start creating new runs again according to its search strategy. Provide the sweep ID that you want to resume:

```bash theme={null}
wandb sweep --resume entity/project/sweep_ID
```

### Stop a sweep

Finish a sweep to stop creating new runs while letting currently executing runs finish gracefully. Use the [`wandb sweep --stop`](/models/ref/cli/wandb-sweep) command:

```bash theme={null}
wandb sweep --stop entity/project/sweep_ID
```

<Warning>
  W\&B does not terminate active [sweeps](/models/sweeps) or agents when you delete a project.
</Warning>

### Cancel a sweep

Cancel a sweep to immediately kill all running runs and stop creating new runs. This is the only sweep command that forcibly terminates existing runs. Runs are terminated abruptly; the running processes have no chance to run user-defined signal handlers. Use the [`wandb sweep --cancel`](/models/ref/cli/wandb-sweep) command to cancel a sweep. Provide the sweep ID that you want to cancel. For more on signals and sweep runs, see [Signal handling and sweep runs](/models/sweeps/signal-handling-sweep-runs).

```bash theme={null}
wandb sweep --cancel entity/project/sweep_ID
```

For a full list of CLI command options, see the [wandb sweep](/models/ref/cli/wandb-sweep) CLI Reference Guide.

<Warning>
  W\&B does not terminate active [sweeps](/models/sweeps) or agents when you delete a project.
</Warning>

## Understanding sweep and run statuses

A sweep orchestrates multiple runs to explore hyperparameter combinations. Understanding how sweep status and run status interact is crucial for effectively managing your hyperparameter optimization.

### Key differences

* **Sweep status** controls whether new runs are created (Running, Paused, Stopped, Cancelled, Finished, Failed, Crashed)
* **Run status** reflects the execution state of individual runs (Pending, Running, Finished, Failed, Crashed, Killed)

### Stop an individual run

When you [stop a run](/models/runs/stop-runs) in a sweep, the sweep agent automatically kicks off the next run in the sweep. This allows you to skip poorly performing configurations without interrupting the sweep's overall progress.

### Best practices

* Use `--pause` instead of cancel when you want to temporarily halt exploration without losing running experiments
* Monitor individual run statuses to identify systematic failures
* Use `--stop` for graceful termination when you've found satisfactory hyperparameters
* Reserve `--cancel` for emergencies when runs are consuming excessive resources or producing errors
