Skip to content

docs: separate the worktree move's permission check from folder trust - #93

Merged
mauricios merged 2 commits into
mainfrom
docs/worktree-move-folder-trust
Oct 18, 2026
Merged

mauricios merged 2 commits into
mainfrom
docs/worktree-move-folder-trust

Conversation

@mauricios

Copy link
Copy Markdown
Contributor

What and why

The approve-worktree-move hook approves change_directory into a worktree of the session's repository, and the docs said that meant no prompt. It answers only Claude Code's permission check: the desktop app then runs its own folder-trust check ("This folder isn't in a workspace you've trusted") before moving the session, and no hook can answer it. Worktrees are siblings of the main checkout, so trusting the main checkout doesn't cover them, and each new worktree asked once.

This corrects the claim and says how to end the prompt: trust the folder that holds the main checkout and its worktrees, once.

  • plugins/adf/hooks/approve-worktree-move.sh: header comment (no behavior change)
  • plugins/adf/hooks/README.md: table row, and a new § Moving into a worktree
  • plugins/adf/docs/PARALLEL-AGENTS.md and /adf:dispatch: the desktop-app step; dispatch tells the developer once after a move the app asked about
  • skeleton/.claude/hooks/config.sh, skeleton/.claude/rules/claude-code.md, docs/ONBOARDING.md: the matching lines
  • CHANGELOG.md: entry with upgrade impact

Verification

  • Ran the installed hook on a real move into a sibling worktree: it returns allow, yet the app still showed its trust prompt, so the prompt is the app's own check.
  • python3 scripts/build-committed.py --check: round trip unchanged.
  • ./evals/run-evals.sh: all pass except worktree-new: with 2 slots, two worktrees take both ports, which fails the same way on main without this change.

Not verified: that trusting the parent folder covers worktrees created later in the desktop app. Claude Code's own trust covers subfolders; the app's check is assumed to work the same way.

🤖 Generated with Claude Code

mauricios and others added 2 commits October 18, 2026 14:40
…lder trust

The approve-worktree-move hook answers Claude Code's permission check for
change_directory, but the desktop app then asks on its own before moving a
session into a folder outside every trusted folder, and no hook can answer
that. Worktrees sit beside the main checkout, so each new one asked once.

Say so in the hook, the hooks README, the parallel-agents guide, /adf:dispatch,
and the skeleton's matching lines, and explain how to end it: trust the folder
that holds the main checkout and its worktrees, once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mauricios
mauricios marked this pull request as ready for review October 18, 2026 21:01
@mauricios
mauricios merged commit e15d953 into main Oct 18, 2026
1 check passed
@mauricios
mauricios deleted the docs/worktree-move-folder-trust branch October 18, 2026 21:01
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.

1 participant