Global settings.json allow list not applied in git worktree sessions

Resolved 💬 6 comments Opened Mar 6, 2026 by devinhedge Closed Apr 4, 2026

Bug Description

Permission prompts appear for tool calls that are explicitly allowed in ~/.claude/settings.json when the session is started from a git worktree directory.

Steps to Reproduce

  1. Add an explicit allow rule to ~/.claude/settings.json:

``json
"Read(/Users/username/workspace/**)"
``

  1. Create a git worktree for a repo, e.g.:

``
/Users/username/workspace/my-repo-worktree/
`
with internal git path:
`
/Users/username/workspace/my-repo/.git/worktrees/my-repo-worktree
``

  1. Start a Claude Code session from the worktree directory
  2. Attempt to read a file under /Users/username/workspace/ (covered by the allow rule)

Expected Behavior

The Read tool call is auto-approved -- no permission prompt shown -- because the path matches the global allow rule.

Actual Behavior

A permission prompt appears requiring manual user approval, despite the path being explicitly covered by the allow list in ~/.claude/settings.json.

Environment

  • macOS Darwin 25.3.0
  • Shell: zsh
  • Model: claude-sonnet-4-6
  • Session CWD: git worktree internal path (.git/worktrees/<name>)
  • Worktree working directory: standard path under /Users/username/workspace/

Additional Context

The global settings.json allow list covers the full workspace tree (/Users/username/workspace/**). The worktree checkout path matches this pattern. The bug only manifests when the session is launched from inside a git worktree. Normal (non-worktree) sessions in the same workspace do not exhibit this behavior.

This makes unattended/autonomous agent workflows impossible inside worktrees because every file operation requires manual approval regardless of configured permissions.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗