claude-code - 💡(How to fix) Fix [BUG] Multi-user macOS: Claude Code exits with code 1 when /private/tmp/claude-settings-<hash>.json is owned by a different UID [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#52993Fetched 2026-04-25 06:15:16
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Error Message

[CCD] [replaceRemoteMcpServers] Calling SDK with 7 total servers [Claude in Chrome, mcp-registry, computer-use, Claude Preview, ccd_session, ccd_directory, scheduled-tasks] [error] Session local_... query error: Claude Code process exited with code 1 stack: 'Error: Claude Code process exited with code 1 at sIr.getProcessExitError (.../index.js:390:8041) at ChildProcess.i (.../index.js:390:11086) at Object.onceWrapper (node:events:623:26) at ChildProcess.emit (node:events:520:35) at ChildProcess._handle.onexit (node:internal/child_process:294:12)' [CCD CycleHealth] unhealthy cycle (0s, hadFirstResponse=false, reason=no_response)

Sentry event IDs: b0a4cd30e958483890ba65596aefbdd5 7c7ac98e103448b6984d6cc1f0dc59bb f0b561cb0a41497eaccd7501822fbf49 db751a5b7e474b94a1c17b780ecc7f3a 17506ad8f5164bbc86840281ac1270c4 1a03d131560d4028b411bc9696be1ca3

Root Cause

The Claude Code child process exits with code 1 on macOS systems with multiple user accounts, because the app writes to /private/tmp/claude-settings-<hash>.json using a filename that is not keyed to the user's UID. The first user to run Claude Code creates this file owned by their UID with mode -rw-r--r--. When a second macOS user subsequently runs Claude Code, their child process fails on this file and exits with code 1, with no user-facing error message. Only a system reboot, or manually removing the file, clears the state.

Fix Action

Fix / Workaround

Confirmed workaround (no reboot needed): sudo rm -rf /private/tmp/claude-*, then retry. User B's Claude Code session then works and creates its own /private/tmp/claude-503/.

Code Example

[CCD] [replaceRemoteMcpServers] Calling SDK with 7 total servers [Claude in Chrome, mcp-registry, computer-use, Claude Preview, ccd_session, ccd_directory, scheduled-tasks]
[error] Session local_... query error: Claude Code process exited with code 1
  stack: 'Error: Claude Code process exited with code 1
    at sIr.getProcessExitError (.../index.js:390:8041)
    at ChildProcess.i (.../index.js:390:11086)
    at Object.onceWrapper (node:events:623:26)
    at ChildProcess.emit (node:events:520:35)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)'
[CCD CycleHealth] unhealthy cycle (0s, hadFirstResponse=false, reason=no_response)

Sentry event IDs:
b0a4cd30e958483890ba65596aefbdd5
7c7ac98e103448b6984d6cc1f0dc59bb
f0b561cb0a41497eaccd7501822fbf49
db751a5b7e474b94a1c17b780ecc7f3a
17506ad8f5164bbc86840281ac1270c4
1a03d131560d4028b411bc9696be1ca3

---

$ ls -la /private/tmp/claude-*
-rw-r--r--  1 userA  wheel   2 Apr 24 15:23 /private/tmp/claude-settings-44136fa355b3678a.json

/private/tmp/claude-502:
drwxr-xr-x  3 userA  wheel  96 Apr 24 15:24 -Users-userA--myProject
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 Code child process exits with code 1 on macOS systems with multiple user accounts, because the app writes to /private/tmp/claude-settings-<hash>.json using a filename that is not keyed to the user's UID. The first user to run Claude Code creates this file owned by their UID with mode -rw-r--r--. When a second macOS user subsequently runs Claude Code, their child process fails on this file and exits with code 1, with no user-facing error message. Only a system reboot, or manually removing the file, clears the state.

What Should Happen?

Claude Code should either (a) include the UID in the settings filename (for example, /private/tmp/claude-<UID>/settings-<hash>.json, matching the pattern already used for the /private/tmp/claude-<UID>/ directory), or (b) use $TMPDIR, which macOS provides as a per-user path. Additionally, when the child process can't read or write expected state files, it should surface a clear error message instead of silently exiting with code 1.

Error Messages/Logs

[CCD] [replaceRemoteMcpServers] Calling SDK with 7 total servers [Claude in Chrome, mcp-registry, computer-use, Claude Preview, ccd_session, ccd_directory, scheduled-tasks]
[error] Session local_... query error: Claude Code process exited with code 1
  stack: 'Error: Claude Code process exited with code 1
    at sIr.getProcessExitError (.../index.js:390:8041)
    at ChildProcess.i (.../index.js:390:11086)
    at Object.onceWrapper (node:events:623:26)
    at ChildProcess.emit (node:events:520:35)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)'
[CCD CycleHealth] unhealthy cycle (0s, hadFirstResponse=false, reason=no_response)

Sentry event IDs:
b0a4cd30e958483890ba65596aefbdd5
7c7ac98e103448b6984d6cc1f0dc59bb
f0b561cb0a41497eaccd7501822fbf49
db751a5b7e474b94a1c17b780ecc7f3a
17506ad8f5164bbc86840281ac1270c4
1a03d131560d4028b411bc9696be1ca3

Steps to Reproduce

  1. macOS machine with two user accounts (User A, UID 502; User B, UID 503). Both signed into Claude Desktop on the same Anthropic account.

  2. User A opens Claude Desktop and starts a Claude Code session. This succeeds and creates:

    • /private/tmp/claude-settings-<hash>.json (owned by UID 502, mode -rw-r--r--)
    • /private/tmp/claude-502/ (owned by UID 502, contains working-directory state)
  3. User A fully quits Claude Desktop via Cmd+Q. Verified via sudo ps aux and sudo launchctl list that no Claude processes or launchd jobs remain.

  4. Switch to User B. Open Claude Desktop and start a Claude Code session.

  5. Result: child process exits with code 1 immediately. No error shown to user.

Confirmed workaround (no reboot needed): sudo rm -rf /private/tmp/claude-*, then retry. User B's Claude Code session then works and creates its own /private/tmp/claude-503/.

Verified file ownership at the moment of reproduction:

$ ls -la /private/tmp/claude-*
-rw-r--r--  1 userA  wheel   2 Apr 24 15:23 /private/tmp/claude-settings-44136fa355b3678a.json

/private/tmp/claude-502:
drwxr-xr-x  3 userA  wheel  96 Apr 24 15:24 -Users-userA--myProject

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Claude 1.3883.0 (93ff6c) 2026-04-21T17:24:01.000Z (bundled Claude Code: 2.1.111)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Extensively debugged before filing. Ruled out: skills plugin, MCP connectors (user-facing and internal), working directory, session state, keychain, auth, folder privacy permissions, and two-user process contention. All ruled out via sudo ps aux, sudo lsof, sudo launchctl list, and full resets of ~/Library/Application Support/Claude/ subdirectories. The /private/tmp/claude-settings-*.json ownership collision is the sole confirmed cause, and removal of that file is the sole required fix to restore function.

Full debugging session logs available on request.

extent analysis

TL;DR

The issue can be fixed by modifying Claude Code to include the user's UID in the settings filename or use the $TMPDIR path to ensure per-user temporary files.

Guidance

  • Modify the settings filename to include the user's UID, for example, /private/tmp/claude-<UID>/settings-<hash>.json, to match the existing pattern used for the /private/tmp/claude-<UID>/ directory.
  • Alternatively, use the $TMPDIR environment variable, which provides a per-user temporary directory path on macOS.
  • When the child process encounters issues reading or writing expected state files, surface a clear error message instead of silently exiting with code 1.
  • Verify the fix by testing Claude Code with multiple user accounts and checking that the settings file is created with the correct ownership and permissions.

Example

No code snippet is provided as the issue is related to file system interactions and permissions, and the exact implementation details are not specified.

Notes

The provided workaround, sudo rm -rf /private/tmp/claude-*, confirms that the issue is related to file ownership and permissions. The fix should ensure that each user's Claude Code session uses a unique settings file path to avoid conflicts.

Recommendation

Apply a workaround by modifying the settings filename to include the user's UID or use the $TMPDIR path, as this addresses the root cause of the issue and provides a clear solution.

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] Multi-user macOS: Claude Code exits with code 1 when /private/tmp/claude-settings-<hash>.json is owned by a different UID [1 participants]