Permission rules: $HOME not expanded during startup validation when checking symlinked config

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 3 comments · opened Aug 16, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Issue

During startup validation, Claude Code resolves symlinks to their absolute paths before evaluating permission rule variables. This causes $HOME to not be expanded in permission rules when the target is a symlink.

Current Behavior

Permission rule:

Read($HOME/cloud/shared-source/Claude/proj_template/**)

Results in permission prompt for reading ./.claude/settings.json (which is symlinked to that path) because the symlink is resolved to /Users/jaclu/cloud/shared-source/... first, then checked against the rule containing the literal string $HOME/....

Workaround

Must use explicit absolute paths for each platform:

Read(//Users/jaclu/cloud/shared-source/Claude/proj_template/**)
Read(//home/jaclu/cloud/shared-source/Claude/proj_template/**)

This violates single-point-of-truth principle when config is shared across platforms via symlinks.

Expected Behavior

Permission rule variables like $HOME should be expanded before or during symlink resolution, not after, so they work consistently for symlinked config files.

View original on GitHub ↗

3 Comments

bcherny collaborator · 1 month ago

Permission rules don't expand environment variables such as $HOME — the rule text is matched literally, so Read($HOME/...) never matches anything. For a home-relative path use the documented ~/ prefix, which resolves to your home directory on both macOS and Linux and therefore also matches the resolved symlink target:

Read(~/cloud/shared-source/Claude/proj_template/**)

The four supported path forms (//path absolute, ~/path home, /path relative to the settings file, path relative to the current directory) are listed here: https://code.claude.com/docs/en/permissions#read-and-edit

Closing as answered by the docs — reply here if the ~/ form still prompts for the symlinked file and we'll reopen.
🤖 Generated with Claude Code

---
_Generated by Claude Code_

jaclu · 1 month ago

Not meant as a complaint or anything, more a curiosity. I asked claude repeatedly about this and to check online docs to ensure it reported on documented features, and my (current) one each time told me that ~ could not be used in .claude/settings.json

github-actions[bot] · 7 days ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.