Skip to content

Copilot Chat extension host crashes when Claude session JSONL files are large (hundreds of MB) after size limit removal #292644

@GuillaumeSMedia

Description

@GuillaumeSMedia

Description
Copilot Chat’s Claude session loader reads and parses very large .jsonl files under ~/.claude/projects. After the size limit removal in microsoft/vscode-copilot-chat#3166, the extension host spikes CPU and crashes when the JSONL files are hundreds of MB.

Large files are agent-*.jsonl files: .claude/projects/..../aaaa-bbbb-cccc..../subagents/agent-abc.jsonl

Steps to Reproduce

  1. Have large Claude session .jsonl files under ~/.claude/projects (e.g., 200–300+ MB each, created by large tool outputs - e.g. large grep results).
  2. Launch VS Code Insiders with Copilot Chat enabled.
  3. Let the extension load chat sessions on startup

Expected Behavior
Copilot Chat should handle large session logs without crashing the extension host, or disable large session logs as now the extension is unusable when the files are present.

Actual Behavior
Extension host CPU spikes and becomes unresponsive, then crashes. Profile shows hot path in _getMessagesFromSession and heavy buffer slicing.

Evidence

  • CPU profile (extension host) shows _getMessagesFromSession as the dominant hotspot:
    • ~76.5% of sampled CPU time (2.21s of 2.89s) in github.copilot-chat dist/extension.js around line 1443.
    • Next hotspot is Buffer.slice (~17.9%), consistent with large string processing.
  • Local Claude session data size:
    • Total .jsonl under ~/.claude/projects: ~1.47 GB across 488 files.
    • Largest single file: ~329 MB.
    • Avg line size in the largest file: ~1.4 MB; largest line: ~2.85 MB.
  • Example of the large line content (structure only): type=progress with data.output ≈ 1.31M chars and data.fullOutput ≈ 1.57M chars.
  • The large progress lines were emitted during a Bash tool run with a repo‑wide grep -rn command, producing massive output that was logged repeatedly.

Environment

  • VS Code Insiders: 1.109.0-insider (f07c55879d2979aa0006d9cb681ca25bb7248dec)
  • Copilot Chat: 0.37.2026020302
  • OS: macOS 26.3 (Build 25D5112c)

Additional Notes
microsoft/vscode-copilot-chat#3166 removed the 5MB read limit to allow large session files. That change appears to trade “file too large” errors for expensive full-file parsing that can crash the extension host.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions