[BUG] Long-running sessions freeze — tool call hangs indefinitely, never returns result (VSCode extension)

Resolved 💬 3 comments Opened Feb 19, 2026 by sai-dhulipala Closed Feb 22, 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?

Long-running Claude Code sessions in the VSCode extension become completely unresponsive. The chat freezes mid-operation — a tool call is issued but its result is never returned. The session becomes permanently stuck, requiring the user to start a new chat and lose all context.

This has been happening repeatedly over the past several days across multiple unrelated projects.

Detailed Forensic Analysis

I analyzed my JSONL conversation logs programmatically across all projects over the past 2 weeks. Here are the findings:

The Freeze Pattern

In the most clearly frozen session:

  • Last tool call: Bash (a git commit command) at JSONL line 2274
  • Tool result: Never written to the log — the session hung indefinitely
  • After the freeze: Only file-history-snapshot entries are written (25 of them), indicating the VSCode extension is still alive and writing metadata, but the agent conversation is dead
  • No error message is shown to the user — the chat simply stops responding
Session Statistics at Freeze Point

| Metric | Value |
|--------|-------|
| Session size | 4.2 MB JSONL |
| Assistant messages | 729 |
| Total input tokens (incl. cache) at freeze | ~112,000 |
| Peak tokens before compressions | ~151,000 |
| Context compressions during session | 3 (at 117K→48K, 145K→47K, 151K→50K) |
| Tool errors during session | 26 (MCP errors, sibling errors, user rejections) |
| "Sibling tool call errored" cascades | 9 |

Cross-Project Evidence

I analyzed all large sessions (>500KB) across 5 different projects from the last 2 weeks:

| Date | Project | Size | Msgs | Max Tokens | Task Calls | Sibling Errors | Outcome |
|------|---------|------|------|------------|------------|----------------|---------|
| Feb 19 | Project A | 4.2MB | 729 | 154K | 3 | 9 | FROZEN (tool result never returned) |
| Feb 19 | Project B | 3.5MB | 364 | 167K | 7 | 1 | OK (completed) |
| Feb 18 | Project B | 4.6MB | 585 | 166K | 7 | 0 | API 500 error at end |
| Feb 16 | Project C | 16.5MB | 971 | 166K | 3 | 2 | OK (completed) |
| Feb 16 | Project A | 3.7MB | 528 | 166K | 2 | 6 | OK (completed) |
| Feb 12 | Project A | 5.3MB | 703 | 166K | 3 | 9 | OK (completed) |

Restart Pattern

Analysis shows ~20 tiny sessions (<5KB) created in the last 2 weeks — these represent sessions where the user had to abandon and restart after the chat became unresponsive. Several occur in rapid succession (e.g., 5 tiny sessions within minutes on Feb 18), suggesting repeated failed attempts to recover.

Potentially Related: "Sibling tool call errored" Pattern

When multiple tools are called in parallel and one fails (e.g., an MCP query returns an error), sibling tool calls in the same block receive a cascading <tool_use_error>Sibling tool call errored</tool_use_error> error. This was observed 9 times in the frozen session. While not the direct cause of the freeze, it:

  1. Wastes context tokens on error messages
  2. May contribute to session degradation over time

What Should Happen?

  1. Tool calls should always complete or timeout with a clear error — never hang indefinitely
  2. The session should remain interactive even after errors
  3. If a tool call truly hangs, there should be a user-visible timeout and option to retry or abort

Reproduction Conditions

Based on analysis, the freeze appears to require:

  • Long-running session: 500+ assistant messages, 3+ MB log size
  • Multiple context compressions: Sessions that hit 150K+ tokens and compress 2-3 times
  • Accumulated tool errors: Sessions with multiple MCP errors and sibling error cascades seem more prone
  • VSCode extension: All observed freezes were in the VSCode native extension

Environment

Claude Code version: 2.1.45
Platform: macOS (Darwin 25.3.0)
IDE: VSCode (native extension)
Shell: zsh
Hardware: Apple Silicon
Model: claude-opus-4-6
MCP servers: Postgres, Linear, Playwright

Possibly Related Issues

  • #24282 — GC Death Spiral in Heap Helper thread during idle long-running session
  • #19344 — GC death spiral causes process freeze with unresponsive Ctrl+C during long sessions
  • #19247 — Basic tool calls hang for unreasonable time
  • #24359 — VSCode extension hangs/loops on complex multi-step tasks (closed as duplicate)
  • #23390 — API Error 400 after context compaction: conversation becomes permanently stuck

Additional Context

The key distinguishing factor from existing reports: this is specifically about the tool call result never being returned in the VSCode extension. The JSONL log clearly shows the assistant's tool call was written, but the tool result line is missing — the session dies silently between "tool call sent" and "tool result received." The VSCode extension continues writing file-history-snapshot entries after the freeze, confirming the extension process is alive but the agent loop is stuck.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗