No automatic cleanup of persisted tool-result cache files in ~/.claude/projects/*/tool-results/

Resolved 💬 3 comments Opened Mar 7, 2026 by bittybruv Closed Mar 11, 2026

Summary

Claude Code persists large tool output to disk when output exceeds the inline display limit (e.g. gh run view --log, large file reads). These files accumulate in ~/.claude/projects/<project-hash>/<session-uuid>/tool-results/ and are never automatically reclaimed.

Expected behavior

Tool-result cache files should be cleaned up automatically — either when the conversation session ends, on application restart, or via a configurable retention policy.

Actual behavior

Files persist indefinitely. Each session creates a new UUID-named subdirectory under ~/.claude/projects/<project>/ and any output that was too large to inline is written there and left behind. Over many sessions and projects this will accumulate unboundedly.

Steps to reproduce

  1. Run any tool that produces large output (e.g. gh run view --log on a large Actions run)
  2. Observe the persisted file written to ~/.claude/projects/.../tool-results/
  3. Close the conversation / restart VS Code
  4. Observe the file is still present

Environment

  • Claude Code VSCode extension
  • Platform: Linux (Azure VM)

Suggested fix

  • Clean up tool-results/ directories when a conversation session ends
  • Or apply a TTL / size-based eviction policy on the ~/.claude/projects/ tree
  • Or at minimum document the cache location and provide a CLI command to prune it

View original on GitHub ↗

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