C:/Program Files/Git/task command crashes extension in project with large session cache
Environment
- Claude Code Version: 2.1.20
- Platform: Windows (win32-x64)
- VSCode Extension
Summary
The /task skill command consistently crashes the Claude Code extension in one project (nix-central-02) but works correctly in another project (nix-testing-01) with identical Claude Code version.
Problem Behavior
1. Initial Issue - Session Cache Loading (RESOLVED)
- Project had 1,475 cached session files
sessions-index.jsonwas 319KB- Loading this index caused 5-10 second freeze affecting ALL Claude Code sessions in VSCode
- Fix Applied: Deleted
C:\Users\RogerSmith\.claude\projects\c--code-nix-central-02\sessions-index.json - This resolved the session cache loading issue
2. Current Issue - API Response Crash (UNRESOLVED)
- After fixing session cache,
/taskcommand still crashes - Timeline of crash:
- T+0s:
/task 24command executed - T+3s: API stream starts (
Stream started - received first chunk) - T+11s: Extension crashes/restarts
- No error messages in output or console
- Crash occurs during API response processing
Steps to Reproduce
- Open a project with 21+ task files in
tasks/folder - Accumulate 1000+ session cache files (may take time)
- Start a new Claude Code session in plan mode
- Execute
/task 24(or any task number) - Observe: Extension crashes ~11 seconds after command execution
What Works
- Same
/taskcommand works perfectly in nix-testing-01 project - Both projects use identical Claude Code version
- Standard Claude Code operations work fine in both projects
Configuration Debugging Attempted
Tried multiple fixes without success:
- ✅ Deleted bloated session cache (helped with startup, not with crash)
- ❌ Disabled new skills (debugging-diagnostics, database-migrations, feature-scaffolding)
- ❌ Disabled modified skills (testing-patterns, react-ui-patterns)
- ❌ Disabled settings.local.json
- ❌ Restored original CLAUDE.md (before optimizations)
- ❌ Replaced task.md with simpler working version from nix-testing-01
Project Differences
nix-central-02 (crashing):
- 21 active task files (largest: 573 lines)
- 1 closed task file
- 7 project skills
- Optimized CLAUDE.md (153 lines, references skills)
nix-testing-01 (working):
- Fewer task files
- Simpler configuration
- Same task.md structure
Logs - Crash Timeline
2026-01-28T01:17:10.590Z [DEBUG] command-message tags in metadata: 1
2026-01-28T01:17:10.836Z [DEBUG] [API:auth] OAuth token check starting
2026-01-28T01:17:10.846Z [DEBUG] [API:auth] OAuth token check complete
2026-01-28T01:17:13.971Z [DEBUG] Stream started - received first chunk
[8 seconds of no output]
2026-01-28T01:17:21.992Z [info] Claude code extension is now active?
2026-01-28T01:17:21.992Z [info] MCP Server running on port 62161 (localhost only)
Non-Critical Warnings (Present in Both Projects)
[ERROR] Failed to refresh marketplace claude-plugins-official
[ERROR] MCP server "claude-vscode" Failed to fetch tools: MCP error -32601: Method not found
Expected Behavior
/task 24 should load the task file and enter plan mode, as it does in nix-testing-01 project.
Actual Behavior
Extension crashes during API response processing with no error message, requiring restart.
Impact
/taskskill completely unusable in affected project- Crash affects all Claude Code sessions in same VSCode instance
- Requires VSCode restart to recover
Additional Context
The crash occurs specifically during API response processing after EnterPlanMode is called by the task skill. The issue appears to be related to how Claude Code processes large task files or project configurations when entering plan mode.
The session cache issue suggests that projects with many sessions (1000+) may encounter performance problems. Consider implementing:
- Automatic cleanup of old session cache files
- Pagination or lazy loading of session indices
- Size limits on session cache to prevent bloat
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗