Problem
The permissions.sh PreToolUse hook classifies all CLAUDE.md writes as config-file redirects, emitting:
REDIRECT: config path must persist across sessions. Write to: ~/src/cn/.github/CLAUDE.md
This blocks legitimate edits to CLAUDE.md on PR branches in worktrees (e.g. .worktrees/87b94d50/CLAUDE.md). The file is a committed repo artifact, not a session config file.
Reproduction
- Create a worktree for a repo that has
CLAUDE.md committed
- Checkout a feature branch in the worktree
- Attempt to edit
CLAUDE.md via the Edit tool
Expected: Edit succeeds (path is inside .worktrees/)
Actual: Hook blocks the edit and redirects to the main checkout path
Workaround
Use sed via the Bash tool instead of the Edit tool.
Suggested Fix
When the target path is inside a .worktrees/ directory, skip the config-file redirect logic. The worktree path signals that this is a branch-content edit, not a session-config write.
Source
Discovered during PR ChowNow/.github#116 review feedback implementation (2026-04-03).
Problem
The
permissions.shPreToolUse hook classifies allCLAUDE.mdwrites as config-file redirects, emitting:This blocks legitimate edits to
CLAUDE.mdon PR branches in worktrees (e.g..worktrees/87b94d50/CLAUDE.md). The file is a committed repo artifact, not a session config file.Reproduction
CLAUDE.mdcommittedCLAUDE.mdvia the Edit toolExpected: Edit succeeds (path is inside
.worktrees/)Actual: Hook blocks the edit and redirects to the main checkout path
Workaround
Use
sedvia the Bash tool instead of the Edit tool.Suggested Fix
When the target path is inside a
.worktrees/directory, skip the config-file redirect logic. The worktree path signals that this is a branch-content edit, not a session-config write.Source
Discovered during PR ChowNow/.github#116 review feedback implementation (2026-04-03).