[BUG] VSCode Extension - Error: Claude Code process exited with code 1 - when using background tasks
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?
More often than not, when using Claude Code VSCode extension (in code-server), if Claude initiates a background task, Claude Code ends up terminating or at least showing a message that it was terminated at some point during the same session.
Error: Claude Code process exited with code 1
I can close the error message and keep using Claude normally.
It seems to me this can happen whether or not the background tasks timed out. I did not encounter this issue in the CLI.
What Should Happen?
Claude Code extension should not crash nor show Error: Claude Code process exited with code 1 when background tasks are used in a session.
Error Messages/Logs
## Logs from one repro
2025-12-17 06:26:06.241 [info] From claude: 2025-12-17T06:26:06.241Z [DEBUG] Metrics export disabled by organization setting
2025-12-17T06:26:06.241Z [DEBUG] BigQuery metrics exporter flush complete
2025-12-17T06:26:06.241Z [DEBUG] BigQuery metrics exporter flush complete
2025-12-17T06:26:06.241Z [DEBUG] BigQuery metrics exporter shutdown complete
2025-12-17 06:26:06.276 [info] Closing Claude on channel: f3cem7ubp0i
2025-12-17 06:26:06.276 [error] Error from Claude (on channel f3cem7ubp0i): Error: Claude Code process exited with code 1
## Logs from another repro
2025-12-17 06:24:47.526 [info] From claude: 2025-12-17T06:24:47.526Z [DEBUG] BigQuery metrics exporter flush complete
2025-12-17T06:24:47.526Z [DEBUG] BigQuery metrics exporter shutdown complete
2025-12-17 06:24:47.574 [info] Closing Claude on channel: tv5trkw6569
2025-12-17 06:24:47.574 [error] Error from Claude (on channel tv5trkw6569): Error: Claude Code process exited with code 1
Steps to Reproduce
In one instance, I repro-ed via (this illustrates issue can occur even if bg task doesn't time out):
- Open Claude Code VSCode extension (in code-server)
- Submit prompt: Run a bg task with 5s timeout:
sleep 1 - Claude Code responded as follows and then "crashed" at least in the sense of showing me
Error: Claude Code process exited with code 1
I'll run the sleep command as a background task with a 5-second timeout.
Bash Sleep for 1 second
IN
sleep 1
OUT
Command running in background with ID: b5c1c76. Output is being written to: /tmp/claude/tasks/b5c1c76.output
The command has been started as a background task with ID b5c1c76. The sleep command will complete in about 1 second, well within the 5-second timeout. You can check the output using the TaskOutput tool with the task ID if needed.
In another instance, I repro-ed via (this illustrates issue can occur even if bg task does time out):
- Open Claude Code VSCode extension (in code-server)
- Submit prompt: Run a bg task with 1s timeout:
sleep 5 - Claude Code responded as follows
I'll run the sleep 5 command as a background task with a 1 second timeout.
Bash Sleep for 5 seconds
IN
sleep 5
OUT
Command running in background with ID: bdc87dc. Output is being written to: /tmp/claude/tasks/bdc87dc.output
The command is now running in the background with task ID bdc87dc. Since the timeout is set to 1 second but the sleep command runs for 5 seconds, the command will be terminated after 1 second when it exceeds the timeout. You can check the output of this background task using the TaskOutput tool with task ID bdc87dc, or view the output file directly at /tmp/claude/tasks/bdc87dc.output.
- I then submitted the prompt
testand Claude immediately "crashed" at least in the sense of showing meError: Claude Code process exited with code 1
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.0.72
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
No response