[BUG] Trust prompt and session reload triggered repeatedly when invoking 'claude' with uppercase casing (CLAUDE) on macOS
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
On macOS, invoking the CLI with uppercase casing (e.g. CLAUDE instead of claude) causes Claude Code to:
- Re-display the "Quick safety check: Is this a project you created or one you trust?" workspace trust prompt every single time, even after previously selecting "Yes, I trust this folder" in the same directory.
- Start a fresh session instead of resuming the previous conversation for the current working directory.
which CLAUDE resolves to the same binary as which claude (/usr/local/bin/claude) because macOS's default APFS filesystem is case-insensitive, so the shell executes the identical binary. However, Claude Code appears to treat the invocation as a different context - likely using the invoked command name (or some path derived from it) as part of the trust cache / session lookup key, resulting in a case-sensitive miss.
This looks similar in nature to issue #45195 (Windows drive-letter casing mismatch in .claude.json project key lookup), but for the invocation command name on macOS.
What Should Happen?
Since CLAUDE and claude resolve to the exact same binary on a case-insensitive filesystem, Claude Code should:
- Recognize the workspace as already trusted (trust prompt should not reappear)
- Resume the most recent session for the current working directory, just as it does when invoked as claude
The invoking command's casing should not affect trust state or session continuity.
Error Messages/Logs
None. The trust prompt simply reappears every time.
Steps to Reproduce
- On macOS, open a terminal in any project directory (e.g. ~/your/project/path)
- Run claude (lowercase) — accept the workspace trust prompt by selecting "Yes, I trust this folder"
- Have a brief conversation so a session exists for this directory, then exit
- In the same directory, run claude (lowercase) again → ✅ Trust prompt does NOT appear, previous session is resumed (expected behavior)
- In the same directory, run CLAUDE (uppercase) → ❌ Trust prompt reappears, and a fresh session starts instead of resuming
- Accept the trust prompt again, exit, then run CLAUDE once more → ❌ Trust prompt still appears every single time when invoked with uppercase
Claude Model
None
Is this a regression?
I don't know
Last Working Version
N/A
Claude Code Version
v2.1.150
Platform
Subscription: Claude Max (not API)
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
- The same binary at /usr/local/bin/claude is executed in both cases — confirmed via which
- Suspected root cause: trust state and/or session cache is keyed by the invoking command string (argv[0]) rather than the resolved binary path or normalized lowercased name
- Workaround: always invoke as claude (lowercase)
- Possibly related: #45195 (Windows drive-letter case mismatch in project key lookup)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗