Read/Grep/Edit denied for src/main/java paths with no matching permission/sandbox rule anywhere in config
Description
Read, Grep, and Edit tool calls are denied for files under a specific subpath (src/main/java/** of a Maven module) with the message:
File is in a directory that is denied by your permission settings.
Sibling paths in the exact same module (pom.xml, src/main/resources/**) are readable without issue — only src/main/java/** is blocked. This reproduces consistently across multiple fresh sessions and after fully quitting and relaunching the Claude Code app (not just restarting the terminal).
Environment
- Claude Code version: 2.1.218
- OS: Windows 11 (Windows 11 Pro 10.0.26200)
- Shell: Git Bash (MINGW64) / PowerShell 5.1
- Working directory: multi-root workspace, project root
D:\dev, target files underD:\dev\workspace_backend\<module>\src\main\java\**
Steps to reproduce
- Open a project at
D:\devcontaining a nested directoryworkspace_backend\<maven-module>\src\main\java\...\SomeFile.java. - Call
Read(orGrep/Edit) on that file. - Observe:
File is in a directory that is denied by your permission settings. - Call
Readon a sibling file in the same module outsidesrc/main/java(e.g.pom.xml, or a file undersrc/main/resources/**) — succeeds normally.
What we checked (all clean — no rule found anywhere)
D:\dev\.claude\settings.jsonandsettings.local.json— nosandboxkey, no deny rule matching this path.workspace_backend\.claude\settings.jsonandsettings.local.json— explicitly containRead,Read(**/src/main/java/**),Edit(**/src/main/java/**)inpermissions.allow;denyonly listsEdit(douzone-comet-webapp-boot/**), unrelated.- No
managed-settings.jsonpresent at any enterprise policy path. ~/.claude.jsonproject entries for bothD:/devandD:/dev/workspace_backend—allowedTools: [], no per-project deny cache,hasTrustDialogAccepted: true.- No relevant
sandbox/SANDBOX/CLAUDE_CODE_*environment variables set beyond standard session identifiers. - Confirmed not a path-length/MAX_PATH issue (paths are ~110-140 chars).
- Confirmed not the backslash/case-variant permission-matching bug fixed in 2.1.162 (changelog) — already long since included in 2.1.218.
Attempted fixes that did NOT resolve it
- Removed a previously-present (unrelated-looking)
sandbox.filesystem.allowReadblock fromsettings.local.json— no change. - Restarted the terminal / started a fresh session (new
CLAUDE_CODE_SESSION_ID) — no change. - Fully quit and relaunched the Claude Code app (not just the terminal) — no change.
The denial is precisely and consistently scoped to src/main/java/** under this workspace, while every other sibling path in the same directory tree is accessible, and no discoverable configuration anywhere in the reachable settings hierarchy (project, nested project, user, legacy global cache, env) produces this rule. This suggests either an internal/hardcoded path-matching bug (e.g. something about the src/main/java segment or its depth/nesting) or a sandbox boundary computed at session start from a source we could not locate/inspect from within the session.
Happy to provide additional repro details if needed.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗