VS Code Copilot Chat freezes when many Claude Code sessions exist in ~/.claude/projects/
Resolved 💬 3 comments Opened Feb 4, 2026 by dimi4ik Closed Feb 7, 2026
Bug Description
VS Code Copilot Chat Extension (v0.37) becomes completely unresponsive (99.99% CPU) when a project has many Claude Code CLI session files (.jsonl) in ~/.claude/projects/<project-slug>/.
Environment
- VS Code: Insiders 1.109.0 (darwin-arm64)
- Copilot Chat Extension: v0.37.2026020404 (pre-release)
- Claude Code: v2.1.31
- OS: macOS Darwin 25.1.0 (arm64)
Root Cause
The Copilot Chat Extension includes a ClaudeCodeSessionService that calls _loadSessionsFromDisk() on startup. This function reads all .jsonl files from ~/.claude/projects/<project-slug>/ synchronously, parsing every line.
In our case:
- 241 session files totaling 287 MB in a single project directory
- The function consumed 99.99% of CPU for 5+ seconds, making the Extension Host completely unresponsive
- The Chat UI appeared functional but could not process any input
CPU Profile Evidence
38844 hits | _loadSessionsFromDisk | extension.js:1442:9616
3 hits | (program)
Steps to Reproduce
- Use Claude Code CLI extensively in a project (accumulate 200+ sessions / 250+ MB in
~/.claude/projects/) - Open the same project in VS Code with Copilot Chat Extension
- Open the Copilot Chat panel and try to send a message
- Chat appears to accept input but never responds
Workaround
Move old .jsonl session files from ~/.claude/projects/<project-slug>/ to an archive directory:
PROJ_DIR="$HOME/.claude/projects/<your-project-slug>"
mkdir -p "$PROJ_DIR/_archived_sessions"
mv "$PROJ_DIR"/*.jsonl "$PROJ_DIR/_archived_sessions/"
Suggested Fix
Consider one or more of:
- Lazy loading: Only load session metadata on startup, parse full content on demand
- Pagination: Limit the number of sessions loaded (e.g., most recent 20)
- Async loading: Use non-blocking I/O to prevent Extension Host freeze
- Session cleanup: Provide a built-in mechanism to archive/purge old sessions
- Size limit: Skip files exceeding a certain size threshold
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗