Old cache directories in `~/.config/Cursor/CachedData` accumulate indefinitely without automatic cleanup

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor creates cache directories in ~/.config/Cursor/CachedData for each version, but never automatically removes old cache directories from previous versions. This causes the .config directory to grow indefinitely, making backups difficult and wasting disk space.

Steps to Reproduce

  1. Install and use Cursor for several months
  2. Update Cursor multiple times (each version creates a new cache directory)
  3. Check ~/.config/Cursor/CachedData directory size:
    du -sh ~/.config/Cursor/CachedData
    
  4. List cache directories and their ages:
    cd ~/.config/Cursor/CachedData
    find . -maxdepth 1 -type d -name "[0-9a-f]*" -exec sh -c 'dir="$1"; age=$(find "$dir" -type f -name "*_0" -printf "%T@\n" 2>/dev/null | sort -n | tail -1); if [ -n "$age" ]; then days=$(( ($(date +%s) - ${age%.*}) / 86400 )); size=$(du -sh "$dir" 2>/dev/null | cut -f1); echo "$days days old: $dir ($size)"; fi' _ {} \;
    
    

Expected Behavior

  1. Automatic cleanup: Cursor should automatically remove cache directories older than a reasonable threshold (e.g., 30 days) when it starts up or periodically
  2. Keep recent caches: Only cache directories from recent versions (e.g., last 2-3 versions) should be retained
  3. Respect XDG spec: Ideally, cache should be moved to ~/.cache/Cursor/CachedData per XDG Base Directory specification (see related issue #89964)

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.45
VSCode Version: 1.99.3
Commit: 3ccce8f55d8cca49f6d28b491a844c699b8719a0
Date: 2025-09-22T18:22:38.013Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.14.0-33-generic

Additional Information

Workaround:
I’ve created a manual cleanup script, but this should be handled automatically by Cursor:

# Manual cleanup of cache directories >30 days old
find ~/.config/Cursor/CachedData -maxdepth 1 -type d -name "[0-9a-f]*" -exec sh -c 'dir="$1"; age=$(find "$dir" -type f -name "*_0" -printf "%T@\n" 2>/dev/null | sort -n | tail -1); if [ -n "$age" ]; then days=$(( ($(date +%s) - ${age%.*}) / 86400 )); if [ $days -gt 30 ]; then rm -rf "$dir"; fi; fi' _ {} \;

Related Issues:

Suggested Solution:

  1. Implement automatic cleanup of cache directories older than 30 days on Cursor startup
  2. Keep only the last 2-3 versions’ cache directories
  3. Move cache to ~/.cache/Cursor/CachedData per XDG spec (addresses both issues)

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. I’ll pass this to the team - Cursor should automatically clean up old cache directories.

Your suggestions make sense:

  • Auto-clean caches older than 30 days on startup
  • Keep only the last 2–3 versions
  • Move to ~/.cache/Cursor/CachedData per the XDG spec (which would also address the related issue you linked)

Your manual cleanup script is a good workaround until this is fixed. I’ll update this thread when there’s progress from the team.

1 Like