Description
When working in a git worktree (e.g., ../worktrees/feature-branch), commands that should be auto-approved based on the main project's permission settings still prompt for approval. The permission system appears to check against the original project path rather than recognizing the worktree as part of the same project.
Steps to Reproduce
- Have a project at
/Users/user/src/project with certain Bash commands configured as auto-approved (e.g., bin/rails test:*)
- Create a git worktree:
git worktree add ../worktrees/feature-branch
- In Claude Code, work in the worktree directory
- Run an auto-approved command like
bin/rails test test/models/some_test.rb in the worktree
- Bug: Permission is requested, referencing the original project path (
./) instead of the worktree path
Expected Behavior
Commands run in a git worktree should inherit the permission settings from the main project, since worktrees share the same .git configuration and are part of the same repository.
Actual Behavior
- Permission prompts appear for commands that should be auto-approved
- The permission prompt references the original project directory (
./) rather than the worktree path (../worktrees/...)
Impact
This breaks the workflow when using git worktrees for parallel development, requiring repeated manual approvals for routine commands.
Environment
- Claude Code CLI
- macOS
- Git worktrees feature
🤖 Generated with Claude Code
Description
When working in a git worktree (e.g.,
../worktrees/feature-branch), commands that should be auto-approved based on the main project's permission settings still prompt for approval. The permission system appears to check against the original project path rather than recognizing the worktree as part of the same project.Steps to Reproduce
/Users/user/src/projectwith certain Bash commands configured as auto-approved (e.g.,bin/rails test:*)git worktree add ../worktrees/feature-branchbin/rails test test/models/some_test.rbin the worktree./) instead of the worktree pathExpected Behavior
Commands run in a git worktree should inherit the permission settings from the main project, since worktrees share the same
.gitconfiguration and are part of the same repository.Actual Behavior
./) rather than the worktree path (../worktrees/...)Impact
This breaks the workflow when using git worktrees for parallel development, requiring repeated manual approvals for routine commands.
Environment
🤖 Generated with Claude Code