claim_acquire
Atomically acquire file domains and exclusive resources for agent tasks, returning shared or isolated checkouts or conflict wait/recovery outcomes.
Instructions
Atomically acquire one file domain plus optional exclusive resources.
Project-files excludes backlog and supports isolation only beneath the primary worktree's canonical .worktrees/ root, with backlog omitted through worktree-specific sparse checkout. Backlog and all-files are primary-worktree-only. The three broad selectors are mutually exclusive; project-files and all-files require scope_reason. Schema-version-2 results return SHARED_CHECKOUT_ACQUIRED, ISOLATED_CHECKOUT_ACQUIRED, CLAIM_SCOPE_CONFLICT_WAIT_REQUIRED, SHARED_CHECKOUT_REQUIRED, SHARED_CHECKOUT_RELEASE_REQUIRED, ISOLATED_CHECKOUT_SETUP_REQUIRED, DIRTY_CHECKOUT_RECOVERY_AUTHORIZATION_REQUIRED, DIRTY_CHECKOUT_RECOVERY_ACQUIRED, or a structured rejection with the copied claim engine's stable exit code. Renamed outcomes also carry legacy_outcome.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | HEAD | |
| task | Yes | ||
| agent | Yes | ||
| files | No | ||
| trees | No | ||
| branch | No | ||
| backlog | No | Select the complete primary-worktree-only backlog. Mutually exclusive with project_files and all_files; returns SHARED_CHECKOUT_RELEASE_REQUIRED when another claim owns the shared checkout, or SHARED_CHECKOUT_REQUIRED from another checkout. | |
| claim_id | Yes | ||
| all_files | No | Select the primary-worktree-only union of project files and backlog. Mutually exclusive with project_files and backlog; requires scope_reason. | |
| resources | No | ||
| repository | Yes | ||
| root_task_id | Yes | ||
| scope_reason | No | Bounded coordination-only reason required for tree, project_files, and all_files ownership. | |
| project_files | No | Select project files excluding backlog. Mutually exclusive with backlog and all_files; requires scope_reason. Eligible isolation is placed at the canonical primary-worktree .worktrees/<claim-id> path with backlog omitted by sparse checkout. | |
| worktree_path | No | ||
| allow_recovery | No | ||
| parent_claim_id | No | ||
| compat_file_directories | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| exit_code | Yes |