docs(rules): add worktree force-remove guard to claim-acquire rule#3307
Merged
AceHack merged 1 commit intoMay 14, 2026
Merged
Conversation
New section "Worktree force-remove guard" between "When this rule applies" and "Composes with other rules" addressing an empirical failure mode that manifested 2026-05-14T18:13Z: Otto-CLI checked out Otto-Desktop's PR #3153 branch to investigate a Codex thread, hit "fatal: already used by worktree at /private/tmp/zeta-otto-id-alloc", and force-removed the worktree to take over. The PR-thread-resolution DOES-NOT-APPLY clause covered the WHY (legitimate cross-Otto work); it did not cover the HOW (force-remove vs new-path). Three operational alternatives now documented: 1. Create new worktree at distinct task-tagged path (cheap, default) 2. Use gh api / GraphQL for branch-state ops requiring no checkout 3. Bus-mediated worktree handoff for rare must-checkout cases Empirical anchor preserved in commit message + docs/hygiene-history/ticks/2026/05/14/1813Z.md Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Extends the claim-acquire rule with guidance for avoiding destructive takeover of another worktree when Git reports a branch is already in use.
Changes:
- Adds a “Worktree force-remove guard” section.
- Recommends alternate worktree/API/bus-handoff approaches.
- Links the guidance to a 2026-05-14 hygiene-history tick shard.
Comment on lines
+62
to
+65
| 1. **Create a new worktree at a different path** for your branch-related | ||
| work. Use a distinct task-tagged path (e.g., `/tmp/zeta-3153-find-fix` | ||
| for thread-investigation; `/private/tmp/zeta-otto-desktop-claim-extend` | ||
| for rule edits) so the two worktrees don't collide. |
Comment on lines
+72
to
+74
| the bus for a claim on that branch first, post a `worktree-handoff` | ||
| advisory envelope, and wait for peer-Otto-side release before | ||
| force-removing. |
Comment on lines
+78
to
+83
| documents force-remove of Otto-Desktop's `/private/tmp/zeta-otto-id-alloc` | ||
| worktree (on PR #3153 branch) to resolve a Codex thread. Worked, but | ||
| substrate-honest: a fresh worktree at `/tmp/zeta-3153-find-fix` would | ||
| have been equally effective and non-destructive. The PR-thread-resolution | ||
| DOES-NOT-APPLY clause covered the WHY of the action; it did not cover | ||
| the HOW. |
| resolution under the DOES-NOT-APPLY clause above), you can do that | ||
| work via `gh api` mutations + GraphQL — no checkout required. | ||
|
|
||
| 3. **If you truly need to checkout peer Otto's branch** (rare), check |
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends .claude/rules/claim-acquire-before-worktree-work.md with a new "Worktree force-remove guard" section covering an empirical failure mode that the existing rule didn't anticipate.
Empirical anchor
docs/hygiene-history/ticks/2026/05/14/1813Z.md (Otto-CLI's tick shard) documents:
The legitimate intent (review-thread resolution) was covered by the existing DOES-NOT-APPLY clause. The mechanism (force-remove) wasn't. This PR adds the missing guard.
Three operational alternatives
Composition
Test plan
🤖 Generated with Claude Code