Skip to content

Kill worktree process

POST
/api/v1/projects/{projectId}/{agentType}/worktrees/{wid}/kill

Kills the tmux session and all child processes for the worktree. The git worktree directory on disk is preserved. This is destructive — any running Claude session is terminated immediately.

projectId
required
string

Project ID

wid
required
string

Worktree ID

OK

object
projectId

ProjectID is the deterministic project identifier the worktree belongs to.

string
state

State is the worktree’s terminal state after the mutation (“connected”, “shell”, “background”, “stopped”). Best-effort — may be empty if the state could not be determined (e.g. container not running).

string
worktreeId

WorktreeID is the worktree identifier.

string

Bad Request

object
code
string
Allowed values: INVALID_BODY INVALID_CONTAINER_ID INVALID_CONTAINER_NAME INVALID_WORKTREE_ID INVALID_WORKTREE_NAME REQUIRED_FIELD INVALID_PATH INVALID_NETWORK_CONFIG NOT_A_DIRECTORY NOT_FOUND NAME_TAKEN NOT_CONFIGURED STALE_MOUNTS BUDGET_EXCEEDED PROXY_ERROR INTERNAL
error
string

Not Found

object
code
string
Allowed values: INVALID_BODY INVALID_CONTAINER_ID INVALID_CONTAINER_NAME INVALID_WORKTREE_ID INVALID_WORKTREE_NAME REQUIRED_FIELD INVALID_PATH INVALID_NETWORK_CONFIG NOT_A_DIRECTORY NOT_FOUND NAME_TAKEN NOT_CONFIGURED STALE_MOUNTS BUDGET_EXCEEDED PROXY_ERROR INTERNAL
error
string

Internal Server Error

object
code
string
Allowed values: INVALID_BODY INVALID_CONTAINER_ID INVALID_CONTAINER_NAME INVALID_WORKTREE_ID INVALID_WORKTREE_NAME REQUIRED_FIELD INVALID_PATH INVALID_NETWORK_CONFIG NOT_A_DIRECTORY NOT_FOUND NAME_TAKEN NOT_CONFIGURED STALE_MOUNTS BUDGET_EXCEEDED PROXY_ERROR INTERNAL
error
string