[BUG] Glob patterns fail to match file paths containing $, +, () characters (React Router/Remix routes)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
Bug Description
Permission glob patterns like Read(**) and Write(**) fail to match file paths containing special characters commonly used in React Router/Remix route file naming conventions ($, +, ()).
Even with Read(**) and Write(**) in .claude/settings.json, Claude Code prompts for permission when accessing files like:
app/routes/$organizationSlug+/reporting+/pivot.$type.($currencyCode).tsx
Steps to Reproduce
- Add permission to
.claude/settings.json:
{
"permissions": {
"allow": [
"Read(**)",
"Write(**)",
"Edit(**)"
]
}
}
- Have files using React Router/Remix route naming conventions containing
$,+, or()in the path
- Ask Claude to read or edit one of these files
- Observe that a permission prompt appears despite
Read(**)being configured
Expected Behavior
Read(**) should match all file paths including those with $, +, and () characters.
Actual Behavior
- Permission prompts appear for files with special characters in their paths
- After user approval, specific rules are added to the session:
````
Applying permission update: Adding 1 allow rule(s) to destination 'session': ["Read(//path/to/routes/$organizationSlug+/reporting+/**)"]
- Note: There's also a double-slash
//at the start of the path in the added rule (potential secondary bug)
Evidence from Debug Logs
[DEBUG] Getting matching hook commands for Notification with query: permission_prompt
[DEBUG] Matched 0 unique hooks for query "permission_prompt" (0 before deduplication)
[DEBUG] Applying permission update: Adding 1 allow rule(s) to destination 'session': ["Read(//path/to/routes/$organizationSlug+/reporting+/**)"]
Affected Characters
| Character | Usage in React Router/Remix | Example |
|-----------|---------------------------|---------|
| $ | Dynamic route segments | $organizationSlug |
| + | Pathless layout routes | reporting+ |
| () | Optional segments | ($currencyCode) |
Environment
- Platform: macOS (Darwin 24.6.0)
- Claude Code: Latest version
- Files using React Router 7 / Remix route file naming conventions
Workaround
None currently - users must approve each file individually, which adds specific rules to the session.
Related Issues
- #6881 - Glob patterns
/**not working (related but different - about recursive matching) - #16170 - Glob
**works for Read but not Write/Edit (closed as duplicate)
Additional Notes
The double-slash in added permission rules (Read(//path/...) suggests there may also be a path normalization issue.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗