Skip to content

Extension host crashes (OOM) when loading large conversation history #25036

Closed as not planned

Description

@codybrom

Bug Report

Description

Claude Code extension causes VS Code extension host to crash with exit code 5 (OOM) when the project has accumulated large conversation history files. The extension attempts to load all conversation .jsonl files into memory at startup, exhausting the V8 heap and crashing the extension host.

Environment

  • Claude Code: v2.1.39
  • VS Code: 1.109.2 (arm64)
  • OS: macOS 26.2 (Darwin arm64)

Reproduction

  1. Use Claude Code extensively over time, accumulating large conversation files in ~/.claude/projects/{project}/
  2. Accumulate 30+ conversation files with several over 20MB (in this case: 508MB, 49MB, 26MB, etc.)
  3. Open VS Code with Claude Code extension enabled
  4. Extension host crashes ~20-30 seconds after startup

Observed Behavior

Extension host crashes with:

[Extension Host] [FileSystemService] file:///.../c236d482-96f3-4a37-986a-9244e9225832.jsonl is a LARGE file (508MB > 5MB)
<--- Last few GCs --->
[82010:0x10400380000] 26944 ms: Scavenge 3681.5 (3747.9) -> 3653.6 (3732.2) MB, pooled: 0.0 MB, 4.62 / 0.00 ms
[82010:0x10400380000] 27004 ms: Scavenge 3696.2 (3762.5) -> 3669.8 (3762.4) MB, pooled: 0.0 MB, 6.57 / 0.00 ms
[82010:0211/105128.382687:ERROR:electron/shell/common/node_bindings.cc:181] OOM error in V8: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory

Main log shows:

Extension host with pid 82010 exited with code: 5, signal: unknown.
[UtilityProcess id: 9, type: extensionHost, pid: 82010]: crashed with code 5 and reason 'crashed'

Expected Behavior

Claude Code should either:

  1. Lazy load conversations - only load conversation metadata at startup, defer full content loading until needed
  2. Archive old conversations automatically - move conversations older than N days to an archive subfolder
  3. Respect heap limits - stream/paginate conversation loading rather than loading all into memory
  4. Warn users - notify when conversation history exceeds safe memory threshold

Workaround

Archive large conversation files manually:

mkdir -p ~/.claude/projects/{project}/archive
mv ~/.claude/projects/{project}/*.jsonl ~/.claude/projects/{project}/archive/
# Move back only recent conversations as needed

After archiving 8 conversations (totaling 600+MB), extension host stabilized.

Impact

  • Severity: Critical - extension completely unusable with accumulated history
  • Scope: Affects long-term Claude Code users with extensive conversation history
  • Misleading symptoms: Crashes were initially attributed to other extensions (GitHub Copilot Chat) during bisect, wasting hours of debugging

Additional Notes

The issue manifested during extension bisect as false positives because:

  1. Claude Code loads conversation history during activation
  2. When bisect disables half the extensions, memory pressure changes slightly
  3. This creates non-deterministic crash timing that appears correlated with other extensions
  4. Makes root cause analysis extremely difficult without checking heap usage

This appears to be a design issue where conversation history loading was not tested with real-world long-term usage patterns.

Activity

  1. github-actions commented on Feb 11, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] VS Code extension crashes with OOM error: conversation history accumulates to 700MB+ causing infinite crash loop #8722
    2. VS Code extension crashes with OOM (2GB+ memory usage) #23071
    3. VS Code extension crashes on startup when most recent session file is large #23953

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. codybrom commented on Feb 11, 2026

    @codybrom
    Author

    Closing as duplicate of #8722 which was filed 4 months ago with the same root cause. Adding findings from this investigation to that issue.

  3. github-actions commented on Feb 19, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  4. locked as resolved and limited conversation to collaborators on Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions