No automatic cleanup of persisted tool-result cache files in ~/.claude/projects/*/tool-results/
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
- Run any tool that produces large output (e.g.
gh run view --logon a large Actions run) - Observe the persisted file written to
~/.claude/projects/.../tool-results/ - Close the conversation / restart VS Code
- 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗