# Claiming and giving back

`tkt ticket claim PAY-001 --assignee <you>` claims a given ticket by the `tkt next` rule; `tkt ticket release PAY-001` gives it back (`in_progress` → `todo`, assignee cleared), from any worktree.

Claimed in another worktree: `ERR_ALREADY_CLAIMED` (`--force` takes it over); not startable: `ERR_NOT_STARTABLE`, with one `details[]` entry per reason.

## Details

- Assignee: `--assignee`, else `AITODO_ASSIGNEE`, else exit 2. Both errors are 409; `ERR_ALREADY_CLAIMED` names the assignee, branch and worktree. Your own `in_progress` ticket again: no change.
- `tkt next --claim` and `tkt ticket update --status in_progress` record a claim too; in git every worktree sees it ([Parallel worktrees](/en/docs/guides/team/worktrees.md#team-worktrees)).
- Release resets the status only where it is `in_progress` (elsewhere the output says it stays so on branch X). Someone else's claim, or no `--assignee`: `ERR_ALREADY_CLAIMED` unless `--force`; claimed neither here nor elsewhere: `ERR_STATUS_TRANSITION`. `done` / `canceled` drop the record, `in_review` keeps it; `tkt ticket release --stale` clears stale ones.

- REST: `GET /v1/tickets:next`, `POST /v1/tickets:next` `{"assignee": "…"}`, `POST /v1/tickets/{ticket_id}:release` ([Store API](/en/docs/reference/store-api.md#ref-store-api)); REST reads no git claims, so use `tkt next` in a worktree.

- `tkt ticket claim --json`: `{ticket, claim, changed}`.

## Commands on this page

- [`tkt ticket claim`](/en/docs/reference/commands/ticket.md#tkt-ticket-claim): Claim one ticket: todo → in\_progress + assignee here, recorded for every worktree
- [`tkt ticket release`](/en/docs/reference/commands/ticket.md#tkt-ticket-release): Give a claimed ticket back, from any worktree: its claim record goes; in a store where it is in\_progress it goes back to todo, assignee cleared

## Related

- Guide: [Parallel work](/en/docs/guides/team/worktrees.md): What can run in parallel, and how two agents work in two worktrees on one store.
- Reference: [Store API](/en/docs/reference/store-api.md): One store's endpoints, for local and dev runs.
- Error code · 409: [`ERR_NOT_STARTABLE`](/en/docs/reference/errors.md#ERR_NOT_STARTABLE): The ticket cannot be claimed: not todo, an open blocker, a block hint, or assigned
- Env var: [`AITODO_ASSIGNEE`](/en/docs/reference/env.md#AITODO_ASSIGNEE): Who claims: the default of --assignee
