You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Permission loader: a settings file that cannot exist, or holds only a BOM, fails closed #4651
With #4287, load_permission_rules adds a catch-all Ask when a Claude Code settings file exists but cannot be read or parsed, and skips missing or empty files. Two inputs fall on the wrong side of that line. Neither file holds any rules, but both get the Ask:
The parent path is not a directory. If a project contains a regular file named .claude, user_dirs::project_root still accepts it as the marker, because it only checks .exists(). The same happens if CLAUDE_CONFIG_DIR points at a file. Reading <that>/settings.json then fails with ENOTDIR (ErrorKind::NotADirectory), not NotFound, so it is treated as unreadable. Windows reports NotFound for the same layout and skips the file, so the result depends on the platform.
The file holds only a UTF-8 BOM. For example, a settings.local.json saved empty by an editor that writes EF BB BF. content.trim() does not remove U+FEFF, so the empty-file check misses it. from_json_str then strips the BOM, fails on the empty input, and the file counts as unparseable.
Measured with rtk rewrite "git status", where the other settings file has allow: ["Bash(git status)"]:
Claude Code permission loader fails closed (adds catch-all Ask) for a non-directory .claude path or a BOM-only settings file instead of treating them as absent/empty, with platform-divergent behavior.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/permissions.rs
src/user_dirs.rs
Suggested Actions
Treat io::ErrorKind::NotADirectory like NotFound when reading settings files (MSRV 1.91, stable since 1.83)
Run the empty-content check after strip_leading_bom in load_permission_rules_from
Add regression tests: .claude as a regular file, and a BOM-only settings.local.json
Activity
rtk-wshm-sync-bot commentedon Oct 18, 2026
🔍 Automated Triage
bugmediumSummary
Claude Code permission loader fails closed (adds catch-all Ask) for a non-directory
.claudepath or a BOM-only settings file instead of treating them as absent/empty, with platform-divergent behavior.📁 Relevant files
src/permissions.rssrc/user_dirs.rsSuggested Actions
.claudeas a regular file, and a BOM-only settings.local.jsonTriaged automatically by wshm · This is an automated analysis, not a human review.