claude-code - 💡(How to fix) Fix [BUG] Desktop app crashes on multi-user Mac: /tmp/claude-settings-*.json ownership collision [1 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#52814Fetched 2026-04-25 06:20:12
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5closed ×1commented ×1

Error Message

Session local_xxx query error: Claude Code process exited with code 1

Root Cause

Key details:

  • The filename is a deterministic hash of {} (the settings content), so every user collides on the same file
  • The CLI works fine standalone (without --settings flag)
  • Only "local sessions" are affected; VM-based sessions work fine because they run inside an isolated VM
  • ALL operations fail: queries, MCP server sync, model switching, context usage checks
  • The desktop retries replaceRemoteMcpServers repeatedly in the background, generating hundreds of error entries

Fix Action

Workaround

sudo rm /tmp/claude-settings-44136fa355b3678a.json

The file will be recreated with the current user's ownership. But it breaks again if the other user opens Claude Desktop first (e.g., after reboot).

Code Example

Error processing settings: EACCES: permission denied, open '/tmp/claude-settings-44136fa355b3678a.json'

---

Error processing settings: EACCES: permission denied, open '/tmp/claude-settings-44136fa355b3678a.json'

---

Session local_xxx query error: Claude Code process exited with code 1

---

$ ls -la /tmp/claude-settings-44136fa355b3678a.json
-rw-r--r--  1 otheruser  wheel  2 Apr 23 17:24 /tmp/claude-settings-44136fa355b3678a.json

---

sudo rm /tmp/claude-settings-44136fa355b3678a.json
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?

The Claude Desktop app (macOS) passes --settings {} to the bundled CLI binary. The CLI hashes this to a deterministic temp filename /tmp/claude-settings-44136fa355b3678a.json and writes the settings there.

On a Mac with multiple user accounts, the first user to open Claude Desktop creates this file with their ownership. When a second user opens Claude Desktop, the CLI crashes immediately with:

Error processing settings: EACCES: permission denied, open '/tmp/claude-settings-44136fa355b3678a.json'

The process exits with code 1 before producing any output. The desktop app shows "Claude Code process exited with code 1" with no further detail - the CLI's stderr is not captured in any log file, making this very hard to diagnose.

Key details:

  • The filename is a deterministic hash of {} (the settings content), so every user collides on the same file
  • The CLI works fine standalone (without --settings flag)
  • Only "local sessions" are affected; VM-based sessions work fine because they run inside an isolated VM
  • ALL operations fail: queries, MCP server sync, model switching, context usage checks
  • The desktop retries replaceRemoteMcpServers repeatedly in the background, generating hundreds of error entries

What Should Happen?

The temp settings file should use a user-specific path. Options:

  1. Include the UID in the filename: /tmp/claude-settings-{hash}-${UID}.json
  2. Use $TMPDIR (macOS sets this to a per-user dir like /var/folders/xx/.../T/): $TMPDIR/claude-settings-{hash}.json
  3. Write to ~/.claude/ instead of /tmp/

Option 2 is the most correct for macOS - $TMPDIR is already per-user and private.

Error Messages/Logs

CLI stderr (only visible via binary wrapper):

Error processing settings: EACCES: permission denied, open '/tmp/claude-settings-44136fa355b3678a.json'

Desktop main.log (unhelpful):

Session local_xxx query error: Claude Code process exited with code 1

File ownership:

$ ls -la /tmp/claude-settings-44136fa355b3678a.json
-rw-r--r--  1 otheruser  wheel  2 Apr 23 17:24 /tmp/claude-settings-44136fa355b3678a.json

Steps to Reproduce

  1. Have two macOS user accounts (User A and User B) on the same Mac
  2. User A opens Claude Desktop app - creates /tmp/claude-settings-44136fa355b3678a.json owned by User A
  3. User B opens Claude Desktop app
  4. Every local session crashes immediately with exit code 1

Workaround

sudo rm /tmp/claude-settings-44136fa355b3678a.json

The file will be recreated with the current user's ownership. But it breaks again if the other user opens Claude Desktop first (e.g., after reboot).

Additional note

The desktop app does not log the CLI's stderr anywhere, so this error is invisible in all log files under ~/Library/Logs/Claude/. The only way to find the actual error was to replace the CLI binary with a wrapper script that captured stderr. Consider logging stderr to help debug future issues.

Claude Model

Opus

Is this a regression?

Yes - started after desktop app auto-updated (around Apr 21, 2026). The --settings flag appears to be new behavior from the updated desktop.

Last Working Version

Desktop version before 1.3883.0 (worked on Apr 20, 2026)

Claude Code Version

2.1.111 (bundled by desktop)

Platform

Claude Pro

Operating System

macOS (Darwin 24.6.0, arm64)

Terminal/Shell

Claude Desktop app (not terminal)

Additional Information

Related but different from #20139, #17034, #18163 which cover /tmp/claude/ directory collisions. This bug is about a separate code path: the --settings CLI flag writing deterministic temp files to /tmp/.

extent analysis

TL;DR

The most likely fix is to modify the CLI to use a user-specific path for the temporary settings file, such as utilizing the $TMPDIR environment variable.

Guidance

  • The issue arises from the deterministic temp filename colliding across users, leading to permission denied errors when a second user attempts to access the file.
  • To verify the issue, check the file ownership of the temp settings file and observe the error message when a second user attempts to run the CLI.
  • A potential mitigation is to use the $TMPDIR environment variable, which is set to a per-user directory on macOS, to store the temp settings file.
  • Consider logging the CLI's stderr to a file to aid in debugging future issues.

Example

# Example of using $TMPDIR to store the temp settings file
tmp_settings_file="$TMPDIR/claude-settings-$(echo {} | hash).json"

Notes

The provided workaround of deleting the temp settings file is not a permanent solution, as the issue will recur when the other user opens the desktop app. A more robust solution involves modifying the CLI to use a user-specific path.

Recommendation

Apply a workaround by modifying the CLI to use the $TMPDIR environment variable to store the temp settings file, as this is the most correct approach for macOS and addresses the permission denied error.

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] Desktop app crashes on multi-user Mac: /tmp/claude-settings-*.json ownership collision [1 comments, 2 participants]