Skip to content

enhance worktree consent during implementation (PRI-974) - #1124

Merged
obra merged 4 commits into
feat-add-multi-repo-worktreefrom
add-worktree-consent-step
Apr 13, 2026
Merged

obra merged 4 commits into
feat-add-multi-repo-worktreefrom
add-worktree-consent-step

Conversation

@arittr

@arittr arittr commented Apr 10, 2026 •

Copy link
Copy Markdown
Collaborator

What problem are you trying to solve?

Drill benchmark showed 0/4 consent compliance across both Claude Code and Codex (PRI-974). Agents skipped the worktree consent gate because it was buried as prose inside Step 0's conditional branch. Agents anchor on code blocks and skip prose — the consent question was invisible to them.

What does this PR change?

Inverts the worktree skill's default: the default path now works in place, and worktree creation is an explicit off-ramp requiring user request. Renumbers steps to clean integers (1-5), adds anti-inference red flags, and restores the silence safety net. Also updates stale references in executing-plans, subagent-driven-development, and codex-tools.

Is this change appropriate for the core library?

Yes — this fixes a compliance failure in the core using-git-worktrees skill that affects all users. Agents were creating worktrees without consent, which is a destructive action.

What alternatives did you consider?

  1. Keeping consent as a sub-step (Step 0.5) with stronger wording — failed because fractional numbering signals "optional" to agents.
  2. Adding a code block to the existing consent step without restructuring — insufficient because the structural gravity still defaulted to worktree creation.

Does this PR contain multiple unrelated changes?

No. All three commits address the same issue (PRI-974): the first promotes consent to its own step, the second inverts the default, the third cleans up stale references from the restructuring.

Existing PRs

Environment tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID
Claude Code latest Claude Opus 4.6 claude-opus-4-6

Evaluation

  • Initial prompt: drill benchmark testing worktree consent compliance
  • 4 eval sessions run after changes (2 Claude Code, 2 Codex)
  • Before: 0/4 consent compliance — agents created worktrees without asking
  • After: agents default to working in place; worktree only on explicit request

Rigor

  • If this is a skills change: I used superpowers:writing-skills and
    completed adversarial pressure testing (paste results below)
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table,
    rationalizations, "human partner" language) without extensive evals
    showing the change is an improvement

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

@arittr

arittr commented Apr 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

arittr and others added 4 commits April 13, 2026 16:31
…-974)

Drill benchmark showed 0/4 consent compliance across both Claude Code
and Codex. Root cause: consent was buried inline in Step 0's conditional
branch. Agents anchor on the next bash command and skip prose.

Fix: promote consent to its own numbered section with imperative framing
("REQUIRED STOP", "Do NOT proceed without an answer") and exact output
template. Also adds explicit "no" path — users who want to work directly
on their current branch skip to Step 3 with no worktree creation.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
… 0.5 (PRI-974)

Agents consistently skipped Step 0.5 (consent gate) because fractional
numbering signals "optional afterthought" and the prose-only step was
invisible to code-block anchoring. The fix inverts the structural
gravity: the default path now works in place, and worktree creation
is an off-ramp requiring explicit user request.

- Renumber to clean integers: Step 1 (detect) → 2 (offer) → 3 (create) → 4 (setup) → 5 (verify)
- Step 2 defaults to Step 4 (in-place); Step 3 only on explicit user ask
- Step 2 includes a code block so agents register it during execution
- Add "creating without being asked" to Common Mistakes
- Add anti-inference red flag: consent from task/plan/skill invocation doesn't count

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Post-inversion cleanup:

- executing-plans, subagent-driven-development: update Integration
  description from "Ensures isolated workspace" to "Detects workspace
  environment and offers worktree isolation on request"
- codex-tools.md: update step references (Step 0→1, Step 1→2)
- using-git-worktrees Step 2: restore "silence → ask once more" instead
  of "silence → work in place" to preserve safety net for confused users

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The skill previously required an explicit reply to its "do you want a
worktree?" dialogue, which produced obtuse UX when the user invoked the
skill by name — agents had to stop and ask "do you want a worktree?"
even though the user just asked for the skill whose purpose is worktrees.

Loosen Step 2 to recognize the invoking turn as consent: if the user's
most recent message named the skill, asked for a worktree, or asked for
an isolated workspace, proceed directly to Step 3 without re-prompting.
The gate still fires for the transitive case (agent infers isolation
from a feature description) — that remains the #991 failure mode.

Also trim "or skill invocation" from the anti-inference Red Flag and
destale the Integration section now that SDD/executing-plans no longer
require a worktree.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@arittr
arittr force-pushed the feat-add-multi-repo-worktree branch from b1e9711 to ddbba8e Compare April 13, 2026 23:35
@arittr
arittr force-pushed the add-worktree-consent-step branch from 72dd30d to 884b1a5 Compare April 13, 2026 23:35
@arittr arittr changed the title fix: promote consent to own Step 0.5 with structural enforcement (PRI-974) enhance worktree consent during implementation (PRI-974) Apr 13, 2026
@obra
obra merged commit 2b205cf into feat-add-multi-repo-worktree Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants