claude_cancel_task
Cancel a running task by run ID. Graceful SIGTERM stops it cleanly; force SIGKILL terminates unresponsive processes.
Instructions
Cancel a running task.
Two escalation levels: - force=false (default): sends SIGTERM (graceful). The subprocess has ~5s to clean up before the OS escalates. Try this first. - force=true: sends SIGKILL (immediate). Use only if the subprocess doesn't respond to SIGTERM within ~5s.
Returns: ClaudeCancelTaskResponse with canceled (bool) and status ("cancelled" if actively stopped, "already_done" if run finished naturally, "not_found" if run_id is unknown).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| req | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | ||
| canceled | Yes |