[BUG] Resuming a background job fails after reboot: saved --settings temp path no longer exists
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?
What happens
After a reboot, reopening an earlier background job fails right away:
exit 1 before init: Error: Settings file not found: /var/folders/<...>/T/cmux-claude-settings.981dve
The conversation transcript (~/.claude/projects/<project>/<sessionId>.jsonl) is still there, but the session can't be resumed.
Cause
When a job starts, its launch flags are saved in ~/.claude/jobs/<id>/state.json under respawnFlags, including --settings <path>. cmux passes a settings file it wrote into $TMPDIR, and macOS clears that folder on reboot. When the job is resumed, the saved flags are replayed, the file is missing, and the CLI exits before it starts up.
Workaround: remove --settings <path> from respawnFlags in each ~/.claude/jobs/*/state.json.
What Should Happen?
Expected: the session resumes. A missing settings file is skipped with a warning, or temporary --settings paths aren't saved in the first place.
Actual: the job fails with exit 1 before init and the session can't be opened. Every job started from cmux has this problem, so one reboot breaks all of them.
Error Messages/Logs
`exit 1 before init: Error: Settings file not found: /var/folders/<...>/T/cmux-claude-settings.981dve`
Steps to Reproduce
- Start a background job with claude --settings $(mktemp) (cmux does this automatically).
- Delete the temp file, or reboot.
- Reopen the job from the job list.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.283
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Working with CMUX terminal: https://github.com/manaflow-ai/cmux