claude_cancel
Kill a running async Claude Code task and its child processes while preserving any worktree and partial output for inspection. Returns structured failure details if the task already failed.
Instructions
Kill a running async Claude Code task and its child processes. Any worktree and partial output are preserved for inspection. If the task had already failed, the response includes its structured failure details.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task_id": "<task_id>"
},
"name": "claude_cancel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task_id to cancel. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| model | No | ||
| status | Yes | ||
| message | No | ||
| task_id | Yes | ||
| exit_code | No | ||
| retryable | No | ||
| failure_cause | No | ||
| worktree_path | No | ||
| exit_code_lost | No | ||
| failure_action | No | ||
| status_inferred | No | ||
| worktree_branch | No | ||
| failure_category | No |