additionalDirectories glob patterns don't match non-existent paths for create operations
Bug Description
Glob patterns (e.g., **) in additionalDirectories settings don't grant permission to create new files or directories under matched paths. The glob appears to resolve against the existing filesystem, so paths that don't yet exist can't match.
Steps to Reproduce
- Add a glob pattern to
~/.claude/settings.json:
``json``
"additionalDirectories": [
"/path/to/project/output/artifacts/**"
]
- Ask Claude Code to create a new subdirectory or file under
/path/to/project/output/artifacts/(e.g.,artifacts/new-folder/file.md) - Claude Code prompts for permission despite the glob pattern covering that path
Expected Behavior
The ** glob should grant permission for creating new files and directories under the matched parent path, not just accessing existing ones.
Actual Behavior
Claude Code prompts the user for permission. Once approved, it adds an explicit literal path entry to additionalDirectories as a workaround:
"/path/to/project/output/artifacts/new-folder"
This explicit entry is redundant once the directory exists, since the original ** glob would then match it.
Environment
- macOS (Darwin 25.3.0)
- Claude Code CLI
Workaround
Approve the permission prompt when asked. The added explicit path can be removed afterward since the glob will match once the path exists.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗