[BUG] --settings <json> writes to shared /tmp/claude-settings-<hash>.json, blocks all but first macOS user account
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?
The bundled CLI's --settings <json> flag hashes the input JSON and writes it to a deterministic path: /tmp/claude-settings-<hash>.json.
Because /tmp/ is shared across all macOS user accounts on the machine, and the hash does not include getuid() (or username), identical --settings arguments produce
identical paths across users. Whichever user spawns the CLI first creates the file with default mode 0644 (owner-write only). Every other macOS user account on the same
Mac then gets EACCES on every spawn and exits 1 before producing any output.
When this CLI is invoked by Claude Desktop, Desktop spawns it through Claude.app/Contents/Helpers/disclaimer, which appears to swallow the child's stderr — so the
underlying EACCES never reaches ~/Library/Logs/Claude/main.log. The only desktop-side signal is Claude Code process exited with code 1, hadFirstResponse=false. Manually
reproducing the spawn from the affected account is required to surface the actual error.
TMPDIR env var is not honored — setting TMPDIR=$HOME/Library/Caches/... does not redirect the file; the CLI still writes to /tmp/. So a per-user TMPDIR is not
an available workaround.
What Should Happen?
Two macOS user accounts on the same Mac should each be able to use Claude Desktop / the bundled CLI concurrently, without interfering.
Any of the following would fix this:
- Include
getuid()(oros.userInfo().username) in the hash so per-user paths don't collide. - Write to
os.tmpdir()/$TMPDIR/$XDG_CACHE_HOME(each macOS user already has a private$TMPDIRunder/var/folders/.../T/) instead of hardcoded/tmp/. - Create the file with mode
0666. The cache is content-addressed (same input → same hash → same bytes), so concurrent writes from different users produce identical
content and sharing is data-safe.
Error Messages/Logs
# Reproduced manually under the affected account:
$ echo '' | "$HOME/Applications/Claude.app/Contents/Helpers/disclaimer" \
"$HOME/Library/Application Support/Claude/claude-code/2.1.128/claude.app/Contents/MacOS/claude" \
--output-format stream-json --verbose --input-format stream-json \
--setting-sources=user,project,local --settings '{}'
Error processing settings: EACCES: permission denied, open '/tmp/claude-settings-44136fa355b3678a.json'
# What Claude Desktop logs (with no child stderr):
[info] Using Claude Code binary at: /Users/<user>/Library/Application Support/Claude/claude-code/2.1.128/claude.app/Contents/MacOS/claude
[error] Session ... query error: Claude Code process exited with code 1
[CCD CycleHealth] unhealthy cycle for ... (0s, hadFirstResponse=false, reason=no_response)
# File state on disk:
$ ls -la /tmp/claude-settings-*
-rw-r--r--@ 1 <userA> wheel 2 /tmp/claude-settings-44136fa355b3678a.json
$ cat /tmp/claude-settings-44136fa355b3678a.json
{}
Steps to Reproduce
- On a Mac with two user accounts (A and B), install Claude Desktop in each user's
~/Applications/. - User A logs in and opens Claude Desktop. The desktop CCD spawns the bundled CLI with
--settings '{}'. Session works./tmp/claude-settings-44136fa355b3678a.jsonis
now owned by A, mode 0644.
- User B fast-user-switches in and opens Claude Desktop. Every session fails with exit 1 and
hadFirstResponse=false. UI never renders a response. - Manually reproduce B's spawn from a Terminal in B's account:
echo '' | "$HOME/Applications/Claude.app/Contents/Helpers/disclaimer" \
"$HOME/Library/Application Support/Claude/claude-code/2.1.128/claude.app/Contents/MacOS/claude" \
--output-format stream-json --verbose --input-format stream-json \
--setting-sources=user,project,local --settings '{}'
→ Error processing settings: EACCES: permission denied, open '/tmp/claude-settings-44136fa355b3678a.json'
- Confirm
TMPDIRis not honored:
mkdir -p "$HOME/Library/Caches/claude-tmp-test"
TMPDIR="$HOME/Library/Caches/claude-tmp-test" echo '' | \
"$HOME/Applications/Claude.app/Contents/Helpers/disclaimer" \
"$HOME/Library/Application Support/Claude/claude-code/2.1.128/claude.app/Contents/MacOS/claude" \
--output-format stream-json --verbose --input-format stream-json \
--setting-sources=user,project,local --settings '{}'
→ Still EACCES on /tmp/claude-settings-*.json. $TMPDIR is empty.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.128 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
- macOS 26.4.1 (arm64), build 25E253
- Claude Desktop 1.6259.1
- Bundled CLI path: ~/Library/Application Support/Claude/claude-code/2.1.128/claude.app/Contents/MacOS/claude
- Desktop spawns the CLI via Contents/Helpers/disclaimer, which appears to suppress the child's stderr — that's why the EACCES never surfaces in main.log and the only
desktop-side signal is the generic "process exited with code 1".
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗