[Bug] `~/.claude/debug` grows unbounded with no automatic cleanup
Resolved 💬 3 comments Opened Feb 24, 2026 by aravindhaspire Closed Feb 28, 2026
Description
The ~/.claude/debug directory accumulates one large .txt debug log file per session with no automatic cleanup or retention policy. Over time this can consume massive amounts of disk space.
Steps to Reproduce
- Use Claude Code regularly over several weeks
- Check
du -sh ~/.claude/debug/
Impact
- 44,635 files accumulated over ~4 weeks
- 179 GB of disk space consumed
- Average ~4 MB per session log
Expected Behavior
Claude Code should either:
- Automatically delete debug logs older than N days, or
- Cap the total size/ file count of the debug folder, or
- Provide a setting to disable/limit debug logging
Workaround
Manually delete the folder and set up a cron job:
0 3 * * * find ~/.claude/debug -name '*.txt' -mtime +7 -delete
Environment
- macOS Tahoe 26.3.0
- Claude Code (claude-sonnet-4-6)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗