Cancel a create job or local run
claude_cancel_sessionStop a running cloud-session creation or local job by ID, session ID, or URL, terminating its processes and reporting whether it stopped. Already-created cloud sessions keep running.
Instructions
Stop a claude_create_cloud_session job or claude_run_local job that is still running: every process it started on this machine (git, the pty helper, claude --cloud or claude -p) gets SIGTERM, then SIGKILL 5 s later. Pass the job_id, or for a create job the session id or URL it already printed. Waits up to about 6 s for the processes to exit and reports stopped. This does not stop a cloud session: one the CLI already created keeps running at its session_url. A job that already finished is left as it is (cancelled false), and one that failed returns its error.
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": {
"session": "<session>"
},
"name": "claude_cancel_session"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | Yes | Job to stop: a job id (job_...) from claude_create_cloud_session or claude_run_local, or the session id (session_... / cse_...) or https://claude.ai/code/... URL an unfinished create job printed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job | Yes | The create job after this call, or null for a local run. | |
| stopped | Yes | True when every process the job started has exited. | |
| cancelled | Yes | True when this call cancelled the job. False when it had already finished or been cancelled. | |
| local_job | Yes | The claude_run_local job after this call, or null for a create job. |