claude-code - 💡(How to fix) Fix [BUG] Claude Code crashes with "exited with code 1" on multi-user macOS due to shared /tmp/claude-settings-<hash>.json [1 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#52127Fetched 2026-04-23 07:35:55
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Error Message

From ~/Library/Logs/Claude/main.log:
[error] Session local_... query error: Claude Code process exited with code 1 at sIr.getProcessExitError (/Applications/Claude.app/Contents/Resources/ap p.asar/.vite/build/index.js:390:8041)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)
main.log captures only the exit code, not the child's stderr. I wrapped the
claude binary with a shim that captured stderr. The real error is:
Error processing settings: EACCES: permission denied, open
'/tmp/claude-settings-44136fa355b3678a.json'
The file 44136fa355b3678a is the SHA-256 prefix of {} (empty settings). That
path was already owned by the other user on the machine (mode 644, sticky bit on /tmp blocks overwrite by anyone else).

Root Cause

  1. On a Mac with two local user accounts (A and B), log in as user A.
  2. Open the Claude Desktop app and start a new Claude Code session in any
    directory. Let it succeed — this creates /tmp/claude-settings-<hash>.json owned by A.
  3. Log out, log in as user B.
  4. Open the Claude Desktop app and start a new Claude Code session. It fails
    instantly with "Claude Code process exited with code 1".
  5. Confirm with: ls -la /tmp/claude-settings-* — the file is owned by A, mode 644, and user B can't overwrite because /tmp has the sticky bit.

Fix Action

Fix / Workaround

Workaround: sudo rm /tmp/claude-settings-44136fa355b3678a.json (or sudo chmod 666 on it).

Additional Information

  • The settings blob is hashed for the filename, so any two users whose settings serialize identically (e.g., both {}) will collide on the same path
    in /tmp. Empty settings is the common case.
    • The claude binary already receives TMPDIR=/var/folders/.../T/ in its env,
      which is per-user on macOS. Writing to $TMPDIR (or ~/Library/Application
      Support/Claude/) instead of hard-coded /tmp would eliminate the collision
      entirely.
    • Separately: the Desktop app should capture the child process's stderr into
      main.log (or surface it in the UI). Right now only the exit code is logged, which makes this bug un-diagnosable without patching the binary. I only found the root cause by replacing claude.app/Contents/MacOS/claude with a bash shim that tee'd stderr to a file.
    • Same Mac evidence: /tmp also contains claude-501/ and claude-503/ directories (per-UID), so the app already uses per-user paths for some things — just not for this settings file. The inconsistency is likely the source of
      the regression.

Code Example

From ~/Library/Logs/Claude/main.log:                      
  [error] Session local_... query error: Claude Code process exited with code 1 
      at sIr.getProcessExitError (/Applications/Claude.app/Contents/Resources/ap
  p.asar/.vite/build/index.js:390:8041)                                         
      at ChildProcess._handle.onexit (node:internal/child_process:294:12)       
  main.log captures only the exit code, not the child's stderr. I wrapped the   
  claude binary with a shim that captured stderr. The real error is:            
  Error processing settings: EACCES: permission denied, open                    
  '/tmp/claude-settings-44136fa355b3678a.json'                                  
  The file 44136fa355b3678a is the SHA-256 prefix of {} (empty settings). That  
  path was already owned by the other user on the machine (mode 644, sticky bit
  on /tmp blocks overwrite by anyone else).
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?

Starting a Claude Code session in the Claude Desktop app fails instantly. The Desktop app shows "Claude Code process exited with code 1" and the session never produces a response. This happens on macOS machines with more than one local user account: one user can use Claude Code fine, but any other user on the same Mac gets the crash on every session start.

What Should Happen?

Each user on a multi-user Mac should be able to start a Claude Code session independently, regardless of which user previously ran the app.

Error Messages/Logs

From ~/Library/Logs/Claude/main.log:                      
  [error] Session local_... query error: Claude Code process exited with code 1 
      at sIr.getProcessExitError (/Applications/Claude.app/Contents/Resources/ap
  p.asar/.vite/build/index.js:390:8041)                                         
      at ChildProcess._handle.onexit (node:internal/child_process:294:12)       
  main.log captures only the exit code, not the child's stderr. I wrapped the   
  claude binary with a shim that captured stderr. The real error is:            
  Error processing settings: EACCES: permission denied, open                    
  '/tmp/claude-settings-44136fa355b3678a.json'                                  
  The file 44136fa355b3678a is the SHA-256 prefix of {} (empty settings). That  
  path was already owned by the other user on the machine (mode 644, sticky bit
  on /tmp blocks overwrite by anyone else).

Steps to Reproduce

  1. On a Mac with two local user accounts (A and B), log in as user A.
  2. Open the Claude Desktop app and start a new Claude Code session in any
    directory. Let it succeed — this creates /tmp/claude-settings-<hash>.json owned by A.
  3. Log out, log in as user B.
  4. Open the Claude Desktop app and start a new Claude Code session. It fails
    instantly with "Claude Code process exited with code 1".
  5. Confirm with: ls -la /tmp/claude-settings-* — the file is owned by A, mode 644, and user B can't overwrite because /tmp has the sticky bit.

Workaround: sudo rm /tmp/claude-settings-44136fa355b3678a.json (or sudo chmod 666 on it).

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.111 (Claude Code)

Platform

Other

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • The settings blob is hashed for the filename, so any two users whose settings serialize identically (e.g., both {}) will collide on the same path
    in /tmp. Empty settings is the common case.
    • The claude binary already receives TMPDIR=/var/folders/.../T/ in its env,
      which is per-user on macOS. Writing to $TMPDIR (or ~/Library/Application
      Support/Claude/) instead of hard-coded /tmp would eliminate the collision
      entirely.
    • Separately: the Desktop app should capture the child process's stderr into
      main.log (or surface it in the UI). Right now only the exit code is logged, which makes this bug un-diagnosable without patching the binary. I only found the root cause by replacing claude.app/Contents/MacOS/claude with a bash shim that tee'd stderr to a file.
    • Same Mac evidence: /tmp also contains claude-501/ and claude-503/ directories (per-UID), so the app already uses per-user paths for some things — just not for this settings file. The inconsistency is likely the source of
      the regression.

This happened was using the Desktop App, not the API or Terminal

extent analysis

TL;DR

The issue can be fixed by changing the Claude Code binary to write settings files to a per-user temporary directory instead of the shared /tmp directory.

Guidance

  • The error occurs because the Claude Code process tries to write to a file in /tmp that is already owned by another user, causing a permission denied error.
  • To verify the issue, check the ownership and permissions of the settings file in /tmp using ls -la /tmp/claude-settings-*.
  • A temporary workaround is to remove the existing settings file using sudo rm /tmp/claude-settings-<hash>.json or change its permissions using sudo chmod 666 /tmp/claude-settings-<hash>.json.
  • To fix the issue, the Claude Code binary should be modified to use the TMPDIR environment variable, which is set to a per-user temporary directory on macOS, instead of hard-coding /tmp.

Example

No code example is provided as the fix requires modifying the Claude Code binary.

Notes

The issue is likely a regression introduced in a recent version of Claude Code, as it worked in a previous version. The fix should be applied to the Claude Code binary to ensure that settings files are written to a per-user temporary directory.

Recommendation

Apply a workaround by removing or modifying the permissions of the existing settings file, and request an update to the Claude Code binary to use the TMPDIR environment variable. This will prevent the permission denied error and ensure that each user can start a Claude Code session independently.

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