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

# kill - Cancel operations

<Note>
  **`contree kill` is a top-level shortcut for [operation cancel](./operation) (`contree op cancel`).**

  Both share one argparse setup and one handler. The top-level `kill`
  accepts the same positional UUIDs and `--all` flag as `op cancel`,
  including multiple UUIDs in a single invocation. See the
  [operation - Manage operations](./operation) page for the full description.
</Note>

Cancel running operations. Only active operations (PENDING, ASSIGNED,
EXECUTING) can be cancelled.

## Examples

```bash theme={null}
# Cancel a specific operation
contree kill 3f2a7b...

# Cancel multiple operations in one call
contree kill 3f2a7b... a1b2c3... 9d8e7f...

# Cancel all active operations
contree kill --all
```

## Help output

<div className="contree-terminal" style={{"border":"1px solid rgba(255,255,255,0.15)","borderRadius":8,"overflow":"hidden","margin":"1rem 0"}}><div style={{"background":"#292929","height":24,"display":"flex","alignItems":"center","padding":"0 12px","position":"relative"}}><div style={{"display":"flex","alignItems":"center","flexShrink":0}}><span style={{"display":"inline-block","width":10,"height":10,"borderRadius":"50%","background":"#ff5f57","marginRight":6}} /><span style={{"display":"inline-block","width":10,"height":10,"borderRadius":"50%","background":"#febc2e","marginRight":6}} /><span style={{"display":"inline-block","width":10,"height":10,"borderRadius":"50%","background":"#28c840"}} /></div><div style={{"position":"absolute","left":0,"right":0,"textAlign":"center","fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif","fontWeight":"bold","color":"#999"}}>\$ contree kill --help</div></div><pre style={{"margin":0,"borderRadius":0,"padding":"8px 10px","background":"#1e1e1e","overflowX":"auto"}}><code style={{"fontFamily":"JetBrains Mono, SF Mono, SFMono-Regular, Menlo, Monaco, Cascadia Mono, Segoe UI Mono, Roboto Mono, Oxygen Mono, Ubuntu Monospace, Source Code Pro, Fira Mono, Droid Sans Mono, Consolas, Courier New, monospace","color":"#c5c8c6","whiteSpace":"pre-wrap"}}><span style={{"color":"#61afef","fontWeight":"bold"}}>usage: </span><span style={{"color":"#c678dd","fontWeight":"bold"}}>contree kill</span><span style={{"color":"#c5c8c6"}}> \[</span><span style={{"color":"#98c379"}}>-h</span><span style={{"color":"#c5c8c6"}}>] \[</span><span style={{"color":"#98c379"}}>-a</span><span style={{"color":"#c5c8c6"}}>] </span><span style={{"color":"#98c379"}}>\[UUID\_OR\_REF ...]</span><br /><br /><span style={{"color":"#c5c8c6"}}>Manage operations (list, inspect, cancel).</span><br /><br /><span style={{"color":"#c5c8c6"}}>Aggregates ps/show/kill under a single namespace, and adds multi-UUID</span><br /><span style={{"color":"#c5c8c6"}}>support to \`\`show\`\` and \`\`cancel\`\` so several operations can be acted</span><br /><span style={{"color":"#c5c8c6"}}>on in one invocation.</span><br /><br /><span style={{"color":"#c5c8c6"}}>Subcommands:</span><br /><span style={{"color":"#c5c8c6"}}>  list (ls)             List operations. \`\`contree ps\`\` is an alias.</span><br /><span style={{"color":"#c5c8c6"}}>  show UUID \[UUID...]   Show one or more operation results.</span><br /><span style={{"color":"#c5c8c6"}}>  cancel UUID \[UUID...] Cancel one or more operations (or --all).</span><br /><br /><span style={{"color":"#61afef","fontWeight":"bold"}}>positional arguments:</span><br /><span style={{"color":"#c5c8c6"}}>  </span><span style={{"color":"#98c379","fontWeight":"bold"}}>UUID\_OR\_REF</span><span style={{"color":"#c5c8c6"}}>  Operations to cancel. Accepts UUIDs and session-history references (HEAD, HEAD\~N,</span><br /><span style={{"color":"#c5c8c6"}}>               @, @N, @-N, @+N, :N, bare N).</span><br /><br /><span style={{"color":"#61afef","fontWeight":"bold"}}>options:</span><br /><span style={{"color":"#c5c8c6"}}>  </span><span style={{"color":"#98c379","fontWeight":"bold"}}>-h</span><span style={{"color":"#c5c8c6"}}>, </span><span style={{"color":"#56b6c2","fontWeight":"bold"}}>--help</span><span style={{"color":"#c5c8c6"}}>   show this help message and exit</span><br /><span style={{"color":"#c5c8c6"}}>  </span><span style={{"color":"#98c379","fontWeight":"bold"}}>-a</span><span style={{"color":"#c5c8c6"}}>, </span><span style={{"color":"#56b6c2","fontWeight":"bold"}}>--all</span><span style={{"color":"#c5c8c6"}}>    Cancel every active operation</span><br /><br /><span style={{"color":"#c5c8c6"}}>for coding agents:</span><br /><span style={{"color":"#c5c8c6"}}>  list/show are read-only; cancel mutates remote state</span><br /><span style={{"color":"#c5c8c6"}}>  show and cancel accept multiple UUIDs in one invocation</span><br /><span style={{"color":"#c5c8c6"}}>  show supports @N session-history references inherited from \`contree show\`</span><br /><br /><span style={{"color":"#c5c8c6"}}>agent note:</span><br /><span style={{"color":"#c5c8c6"}}>  Before using this command in an automated workflow, read:</span><br /><span style={{"color":"#c5c8c6"}}>    contree agent</span></code></pre></div>

## Behavior

The CLI sends a `DELETE` request to the API for each UUID. The
operation transitions to `CANCELLED` status. If the sandbox is already
running, execution is interrupted.

`--all` finds and cancels every active operation in the project. When
`--all` is combined with explicit UUIDs, `--all` wins and the explicit
UUIDs are ignored with a `WARNING`.

On per-UUID API errors (e.g. 404 for an unknown UUID), the command
logs the failure and continues with the remaining UUIDs, exiting with
status `1` at the end.

## See also

* [operation - Manage operations](./operation) — the canonical command (`contree kill` is its shortcut)
* [ps - List activity](./ps) — list operations to find UUIDs
* [run - Execute a command in the sandbox](./run) — Ctrl-C during `contree run` also cancels the operation
