[Bug] Claude Code exits with code 1 when inline --settings temp file in /tmp is owned by another user
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?
Claude Desktop Code mode crashes immediately after sending any message.
The UI only shows:
Claude Code crashed
Claude Code process exited with code 1
What Should Happen?
Claude Code should start normally and process the message instead of exiting during startup.
When inline settings are passed with --settings '{}', Claude Code should create a temp settings file in a way that cannot collide with a stale file owned by another local user. For example, it should use a unique per-process temp file or a user-owned temp directory.
If temp settings file creation fails, Claude Desktop should show the original error message, such as EACCES: permission denied, instead of only showing Claude Code process exited with code 1.
Error Messages/Logs
Claude Desktop UI:
Claude Code crashed
Claude Code process exited with code 1
Underlying Claude Code error reproduced from terminal:
Error processing settings: EACCES: permission denied, open '/tmp/claude-settings-44136fa355b3678a.json'
The stale temp file was owned by another local user:
-rw-r--r-- 1 <other-user> wheel 2 <date> /tmp/claude-settings-44136fa355b3678a.json
Claude Desktop launched Claude Code with inline settings:
--settings {}
Steps to Reproduce
- Have a stale temp settings file at /tmp/claude-settings-44136fa355b3678a.json.
- Make sure that file is owned by another local user, so the current user cannot overwrite it.
- Start Claude Desktop and open Code mode.
- Send any message.
- Claude Code exits during startup and Claude Desktop shows: Claude Code process exited with code 1.
This can also be reproduced directly from the terminal with:
"/Users/<user>/Library/Application Support/Claude/claude-code/2.1.128/claude.app/Contents/MacOS/claude" --settings '{}' --version
Failing output:
Error processing settings: EACCES: permission denied, open '/tmp/claude-settings-44136fa355b3678a.json'
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Unknown
Claude Code Version
2.1.133 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
This was observed in Claude Desktop Code mode.
Claude Desktop version: 1.6608.0
Bundled Claude Code version used by Desktop: 2.1.128
Standalone Claude Code CLI version: 2.1.133
The issue was fixed locally by deleting the stale temp file:
sudo rm -f /tmp/claude-settings-44136fa355b3678a.json
After deletion, this command succeeded:
"/Users/<user>/Library/Application Support/Claude/claude-code/2.1.128/claude.app/Contents/MacOS/claude" --settings '{}' --version
Output:
2.1.128 (Claude Code)
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗