ddflow_claim
Claim an item to lease it and create an isolated git worktree, preventing overlapping writes. Refuses conflicting or live leases and suggests alternatives; use force only after recovery confirms a crashed agent's worktree is empty.
Instructions
Lease an item and create its isolated git worktree. Refuses (exit 3) if another agent holds it or holds an item whose file globs overlap, and names what you could take instead. NEVER steals an expired lease: a crashed agent's worktree often holds finished work.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Item id to claim. | |
| note | No | What you intend to do. | |
| force | No | Override a refusal. Legitimate for exactly one thing: retrying after `ddflow_recover` has told you a crashed agent's worktree holds nothing. Forcing past a dependency or a live lease is how two agents end up writing the same file, and the override is recorded either way. | |
| globs | No | Comma-separated path globs this work will write. | |
| no_worktree | No | Lease the item without creating a worktree. For work that is not a code change — a research or review task. |