claude-code - 💡(How to fix) Fix [BUG] Trust prompt and session reload triggered repeatedly when invoking 'claude' with uppercase casing (CLAUDE) on macOS

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…

Error Message

Error Messages/Logs

Root Cause

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.

Fix Action

Fix / Workaround

  • 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)

Code Example

None. The trust prompt simply reappears every time.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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:

  1. 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.
  2. 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

  1. On macOS, open a terminal in any project directory (e.g. ~/your/project/path)
  2. Run claude (lowercase) — accept the workspace trust prompt by selecting "Yes, I trust this folder"
  3. Have a brief conversation so a session exists for this directory, then exit
  4. In the same directory, run claude (lowercase) again → ✅ Trust prompt does NOT appear, previous session is resumed (expected behavior)
  5. In the same directory, run CLAUDE (uppercase) → ❌ Trust prompt reappears, and a fresh session starts instead of resuming
  6. 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)

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Trust prompt and session reload triggered repeatedly when invoking 'claude' with uppercase casing (CLAUDE) on macOS