High CPU usage (100%) when launching Claude Code in project with large cache

Resolved 💬 3 comments Opened Jan 31, 2026 by ScrewBolt 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

  1. Use Claude Code in a project frequently over several days/weeks
  2. The project cache in ~/.claude/projects/ grows large (in my case, 216MB)
  3. Launch Claude Code in that project directory
  4. Run any command (e.g., /usage)
  5. 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 .jsonl files were over 20MB each

## Workaround

Manually deleting the project cache resolves the issue:

``bash
rm -rf ~/.claude/projects/<project-hash>
``

## Expected Behavior

  1. Claude Code should implement automatic cache cleanup (e.g., remove old sessions, limit total cache size)
  2. Or provide a built-in command to manage/clear cache (e.g., claude cache clear)
  3. Large cache should not cause 100% CPU hang on startup

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗