High CPU usage (100%) when launching Claude Code in project with large cache
Status Closed — duplicate
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 3 comments · opened Jan 31, 2026 · closed Jan 31, 2026
Description
When launching Claude Code in a specific project directory, the CLI becomes unresponsive with 100% CPU usage. Even simple commands like /usage cause the system to hang indefinitely.
## Environment
- OS: macOS (Darwin 24.5.0)
## Steps to Reproduce
- Use Claude Code in a project frequently over several days/weeks
- The project cache in
~/.claude/projects/grows large (in my case, 216MB) - Launch Claude Code in that project directory
- Run any command (e.g.,
/usage) - CLI hangs with 100% CPU usage
## Root Cause Found
The issue was caused by accumulated session history files in ~/.claude/projects/<project-hash>/:
- Cache size: 216MB
- Contained 75 items
- Some
.jsonlfiles were over 20MB each
## Workaround
Manually deleting the project cache resolves the issue:
``bash``
rm -rf ~/.claude/projects/<project-hash>
## Expected Behavior
- Claude Code should implement automatic cache cleanup (e.g., remove old sessions, limit total cache size)
- Or provide a built-in command to manage/clear cache (e.g.,
claude cache clear) - Large cache should not cause 100% CPU hang on startup
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗