ddflow_claim
Lease a work item and create its isolated git worktree, refusing when another agent holds it and suggesting alternatives. Prevents conflicting edits on shared files.
Instructions
Lease an item and create its isolated git worktree. Refuses (exit 3) if another agent holds it or an overlapping item, and names what you could take instead. NEVER steals an expired lease: a crashed agent's tree often holds finished work.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Item id to claim, or an open bug id (its fix task is claimed, filed first if none). | |
| note | No | What you intend to do. | |
| break | No | Break a contended, idle lease (work kept). | |
| force | No | Override a refusal; only to retry after `ddflow_recover` said a crashed agent's tree holds nothing. Forcing past a dependency or live lease lets two agents write one file. Recorded. | |
| globs | No | Comma-separated path globs this work will write. | |
| queue | No | Queue a refused request (FIFO per file). | |
| approval | No | An agent's way past a refusal --force would override: 'request' asks the operator, then the approval id they answered. | |
| as_agent | No | Subagent name, this call only. | |
| resources | No | Physical resources this claim holds, e.g. 'gpu:2'; they REPLACE the item's declared ones. Refused (exit 3) when live claims already use the capacity ([schedule] resources), every holder counted. | |
| no_worktree | No | Lease the item without creating a worktree. For work that is not a code change — a research or review task. |