Process exits with code 1 mid-session at ~59% context (not saturation)
Description
Claude Code process exits with code 1 mid-session, terminating abruptly without error message or graceful degradation. This happens well below context saturation — the UI shows ~59% context used at the time of crash. No warning, no compaction attempt, just immediate termination.
Error: Claude Code process exited with code 1
View output logs · Troubleshooting resources
Reproduction
Not deterministic, but occurs consistently during heavy tool-use sessions (notebook editing, multi-file code changes, grep/read sequences). Has occurred 6 times out of 92 sessions (~6.5% crash rate) across two different machines.
Common pattern before crash:
- Session involves many sequential tool calls (Read, Edit, Bash, NotebookEdit, Grep)
- Session is actively working — mid-tool-call or between tool calls
- Context meter shows 50-60% used — well below the limit
- No user action triggers it
Crash session details:
| Session | Size | Last Tool Before Crash | Activity |
|---------|------|----------------------|----------|
| 47f61b57 | 0.8MB | NotebookEdit | Editing Jupyter notebook cells |
| 6fbea1da | 2MB | Bash | Code editing + shell commands |
| 1ec7386b | 5MB | TodoWrite | Multi-file editing session |
| f4c27294 | 37MB | Bash/Write | Document generation + code |
| a115b205 | 38MB | Edit | Heavy code editing |
| 8e4aaf91 | 39MB | Read | GPU debugging, reading many files |
All crashed sessions end with file-history-snapshot or last-prompt as final JSONL entry — no proper termination, no error entry in the log.
Expected Behavior
- If approaching context limits: auto-compaction should trigger
- If an internal error occurs: an error message should be displayed, not silent exit code 1
- At minimum: session should be resumable
Actual Behavior
- Process terminates immediately with exit code 1
- No error message in the conversation
- No indication in the session JSONL log of what went wrong
- Session cannot be resumed
- Work in progress is lost
Environment
- Claude Code: 2.1.70 (also on prior versions)
- VSCode extension: anthropic.claude-code@2.1.71
- OS: Ubuntu 24.04.3 LTS (WSL2)
- Kernel: 6.6.87.2-microsoft-standard-WSL2
- Node.js: v18.19.1
- Machine 1: 20 cores, 88GB RAM, RTX 5070
- Machine 2: 24 cores, 27GB RAM, RTX 5080
- Crashes on both machines
Additional Context
- 92 total sessions, 6 crashes (6.5%)
- Crashes span multiple weeks, not a single bad version
- Both small (0.8MB) and large (39MB) sessions crash — size alone doesn't explain it
- Heavy tool-use pattern: Read, Edit, Bash, NotebookEdit, Grep, Glob, Agent subagents
- No custom hooks or unusual configuration
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗