VS Code renderer crashes (code:5) — per-workspace state.vscdb bloats to 63MB, suspected Claude Code background agents

Resolved 💬 2 comments Opened Jun 3, 2026 by antbald Closed Jun 7, 2026

Summary

Opening a specific project folder in VS Code reliably crashes the renderer process with:

CodeWindow: renderer process gone (reason: 'crashed', code: 5)

Root cause traced to the per-workspace state.vscdb growing to 63 MB (normal is < 5 MB), which the VS Code renderer loads into memory on folder open → out-of-memory → crash. The bloat correlates with heavy use of Claude Code's agent / background mode in that workspace.

Environment

  • Claude Code: 2.1.161
  • VS Code: 1.122.1 (arm64), extension anthropic.claude-code
  • OS: macOS (Darwin 25.4.0), Apple Silicon
  • Node: v23.3.0

Evidence

  • ~/Library/Application Support/Code/User/workspaceStorage/<hash>/state.vscdb = 63 MB (+ 63 MB .backup); total workspaceStorage 121 MB.
  • Sibling dirs chatEditingSessions/ and chatSessions/ present and populated.
  • logs/<ts>/main.log: repeated renderer process gone (reason: crashed, code: 5) across many open attempts (a burst of ~10 crashes in ~40 min).
  • Minidumps in Code/Crashpad/completed/*.dmp show --type=renderer (Code Helper (Renderer)) with ANGLE / Metal / IOAccelerator modules loaded.
  • Crash stops after renaming/clearing that workspaceStorage/<hash>/ folder — VS Code recreates a clean, small state DB and the project opens normally.

Suspected cause (unconfirmed)

The bloat correlates with intensive use of Claude Code's agent / background mode in this workspace. The chat editing/session state persisted into VS Code's per-workspace storage appears to grow unbounded and is never pruned. I could not confirm with 100% certainty that the background mode specifically is the writer — flagging as a strong hypothesis so it can be reproduced.

Steps to reproduce (approximate)

  1. Use Claude Code (including agents / background mode) intensively in a large project over time.
  2. Observe state.vscdb for that workspace grow into tens of MB.
  3. Reopen the folder in VS Code → renderer crashes with code: 5.

Workaround

  • Rename/clear the workspace's workspaceStorage/<hash>/ folder (reversible: rename back to restore).
  • Add "disable-hardware-acceleration": true to argv.json — mitigates the GPU-side fragility but does not address the state-bloat root cause.

Expected behavior

Claude Code should cap / prune the chat & editing session state it persists into VS Code workspace storage, so state.vscdb doesn't grow unbounded and crash the renderer.

View original on GitHub ↗

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