acceptEdits mode prompts for files in additionalWorkingDirectories when path is relative
Description
When acceptEdits permission mode is enabled, edits to files inside additionalWorkingDirectories still trigger a permission prompt if Claude Code resolves the file path as a relative path (e.g., ../worktrees/...) instead of an absolute one.
Repro
- Set up a project with this
project-settings.json:
{
"additionalWorkingDirectories": ["~/projects/worktrees"],
"sandbox": {
"enabled": true
}
}
- Primary working directory is
~/projects/code - Enable
acceptEditspermission mode - Ask Claude to edit a file in
~/projects/worktrees/my-branch/my-repo/src/Foo.elm
Expected
Edit is auto-accepted - the file is inside additionalWorkingDirectories.
Actual
Claude shows the edit path as ../worktrees/my-branch/my-repo/src/Foo.elm (relative) and prompts:
Do you want to make this edit to Foo.elm?
Analysis
It appears the relative path ../worktrees/... is not being resolved to its absolute form before checking against additionalWorkingDirectories. The path should resolve to ~/projects/worktrees/... which matches the configured directory, but the matching fails because it's compared as a relative path.
Environment
- macOS
- Claude Code (latest)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗