claude-code - 💡(How to fix) Fix Unnecessary permission prompts for symlinked files in allowed directory [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47821Fetched 2026-04-15 06:41:22
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2
RAW_BUFFERClick to expand / collapse

Bug description

When the current working directory contains symlinks pointing to files in another directory, Claude Code repeatedly asks for read permission on those files — even though:

  1. The files (symlinks) are located within the current project directory
  2. Read permission for the project directory is already granted (e.g., via CLAUDE.md rules or user approval)

Claude Code seems to resolve the symlink target path and then evaluate permissions against the target directory rather than the link location. Since the target directory is different from the project directory, it triggers a permission prompt.

Expected behavior

If a symlink resides inside an allowed directory, reading it should not require additional permission — regardless of where the symlink target points. The permission check should be based on the symlink's location, not the resolved target path.

Steps to reproduce

  1. Create a project directory with a CLAUDE.md that grants read access to all files in the project folder
  2. Add a symlink inside the project directory that points to a file in a different directory (e.g., ln -s /other/path/file.txt ./file.txt)
  3. Ask Claude Code to read ./file.txt
  4. Claude Code will prompt for permission, even though the file is inside the allowed project directory

Environment

  • OS: Windows 10 Pro (also likely reproducible on Linux/macOS)
  • Claude Code: latest version
  • Symlinks created via mklink (Windows) or ln -s (Unix)

Additional context

This is particularly annoying for projects that use symlinks extensively (e.g., shared preamble files, dotfiles, monorepo setups). The user has to repeatedly approve reads for files that should already be permitted.

extent analysis

TL;DR

Modify Claude Code to evaluate permissions based on the symlink's location instead of the resolved target path to fix the permission prompt issue.

Guidance

  • Investigate the permission checking logic in Claude Code to determine why it resolves the symlink target path instead of using the link location.
  • Consider adding a configuration option to toggle between target-based and link-based permission checks.
  • Review the CLAUDE.md rules to ensure they are correctly granting read access to the project directory and its contents, including symlinks.
  • Test the behavior with different types of symlinks (e.g., absolute vs. relative paths) to ensure the fix covers all scenarios.

Example

No code snippet is provided as the issue does not specify the programming language or implementation details of Claude Code.

Notes

The fix may require changes to the underlying file system interaction or permission checking logic in Claude Code, which could have implications for other features or use cases.

Recommendation

Apply a workaround by modifying the permission checking logic in Claude Code to use the symlink's location instead of the resolved target path, as this is the most direct way to address the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If a symlink resides inside an allowed directory, reading it should not require additional permission — regardless of where the symlink target points. The permission check should be based on the symlink's location, not the resolved target path.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING