[BUG] The window terminated unexpectedly (reason: 'killed', code: '9')
Status Open
Reported on v2.1.283
Maintainer reply None cached
Activity 3 comments · opened Sep 27, 2026
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?
With the new versions of claude code and the VSCode extension I now often get
The window terminated unexpectedly (reason: 'killed', code: '9')
It seems this happens when an approval choice is shown, but I didn't recognize a pattern on which ones (perhaps when it has big contents?).
What Should Happen?
Normal claude code behavior.
Error Messages/Logs
The window terminated unexpectedly (reason: 'killed', code: '9')
Steps to Reproduce
I don't know how to exactly reproduce. Claude Code extension works some time and then crashes. I am on Macbook with M4 CPU
Claude Model
Opus
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
Diagnosis from the VS Code logs and crash dumps, with what Claude Code could change: https://github.com/anthropics/claude-code/issues/97584#issuecomment-5854544962
3 Comments
This bug ist very costful because resuming the session after Window reload consumes about 5 € with Opus and 20 € with Fable.
Further problem repeatedly occuring with latest version is "Claude Code stopped responding in this tab, usually because the editor restarted its extensions. Your most recent messages may not have reached Claude. If this notice is still here after a minute, close this tab and reopen the conversation from the session list in the Claude Code sidebar."
Diagnosis from the VS Code logs, and what Claude Code could change
I went through VS Code's logs, the Crashpad dumps and the Claude Code extension's own log for the crashes on 2026-09-27. Short version: every crash and every "Claude Code stopped responding in this tab" happened within a minute or two of starting a Claude Code workflow run with several worktree-isolated agents.
Environment: VS Code 1.139.1; Claude Code 2.1.283 (extension and CLI); macOS 27.0 (26A428) on Apple Silicon, 128 GB RAM, so memory pressure at the OS level is not the issue.
Timeline of one crash (local time, paths shortened)
main.log:CodeWindow: renderer process gone (reason: killed, code: 9)at 08:33 and 10:03. That is theThe window terminated unexpectedly (reason: 'killed', code: '9')in this issue. Crashpad wrote minidumps for both kinds of crash.What Claude Code could change
<workspace>/.claude/worktrees/. VS Code therefore watches and indexes them, and so do all language extensions (TypeScript, ESLint, Vue, Angular, GitLens…).npm ciin its worktree, about 100,000 files each. Five at once overflowed macOS FSEvents: the "Events were dropped … must be re-scanned" lines above, three seconds before the host went unresponsive.files.watcherExcludefor**/.claude/worktrees/**is not enough. I added it, and the same "Events were dropped" warnings came back at 11:06 during the next workflow run, because the FSEvents stream overflows at the workspace root before VS Code applies exclusions.search.excludeandgit.repositoryScanIgnoredFolders) still stops VS Code and the other extensions from reacting to the worktrees. It would be a sensibleconfigurationDefaultsentry in the extension until the worktrees move.update_session_state, 149rename_taband 49show_notificationrequests from the webview, peaking at 15 to 20 messages a second. Many wererename_tabrepeating the same title, andupdate_session_stateflapping.Tool permission request failed: AbortError: Stream closed.extensions.experimental.affinityforanthropic.claude-code.Third-party contribution, reported upstream
The Claude Code Workflow Dashboard extension was also installed. On every file-system event in a workflow run's directory, it synchronously re-reads and re-parses every agent transcript, inside the same extension host. That is reported with source references at https://github.com/gagarinlg/claude-code-workflow-dashboard/issues/3.
Status
I uninstalled that extension and excluded
.claude/worktrees/**from VS Code's watcher.I have not compared older Claude Code versions, so I cannot say which change made this appear. The trigger in practice was starting to use workflows with several worktree-isolated agents: items 1 to 3 above are the Claude Code side of it.
Reproduction that should show items 1 to 3: in VS Code, open a Node project with a lockfile and a few language extensions installed. Start a workflow of five or more agents with worktree isolation, each running
npm ci, and watchrenderer.logand the Claude Code output channel.