CPU 100% when loading session files with saved_hook_context
Resolved 💬 4 comments Opened Mar 2, 2026 by syomakudo Closed Mar 5, 2026
Environment
- Claude Code version: 2.1.27
- OS: macOS 26.3 (Darwin 25.3.0)
- Platform: darwin arm64
Description
Claude Code becomes unresponsive (CPU 100%) when starting a new session in a project directory that contains previous session files with saved_hook_context entries.
Steps to Reproduce
- Use claude-mem plugin (which injects context via hooks)
- Start a session in a project directory, have a conversation, then exit
- Start a second session in the same directory
- CPU usage spikes to 100% during "Calculating..." phase
Investigation Results
- Session file size: ~67KB (20 lines)
- Contains 8
saved_hook_contextentries (~7KB each) - Total
saved_hook_contextdata: ~56KB - When session directory is empty: works normally
- When session file with
saved_hook_contextexists: CPU 100%
Memory footprint observed
- Physical footprint: 2.3GB
- Physical footprint (peak): 9.0GB
Workaround
Deleting session files from ~/.claude/projects/{project}/ resolves the issue temporarily, but it recurs after a new session is created.
Expected Behavior
A 67KB JSONL file should load in milliseconds without causing CPU spike.
Actual Behavior
Loading the session file causes CPU 100% usage and the application becomes unresponsive.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗