A modular, clean architecture application for detecting and removing shader cache files from various applications and game engines.
Shader Cache Remover is a powerful and user-friendly desktop application designed to clean up shader cache files from your system. Shader cache files are temporary files generated by graphics drivers (NVIDIA, AMD, Intel) and game engines (Unreal, Unity) to improve performance. Over time, these caches can become bloated, outdated, or corrupted, leading to wasted disk space and potential performance issues. This tool provides a safe and easy way to clear them out.
The application is built with Python and Tkinter and features a modern, dark-themed interface inspired by Catppuccin.
- Modern GUI: An intuitive and visually appealing graphical user interface with a dark theme
- One-Click Cleanup: Safely delete shader cache files with a single click
- Dry Run Mode: Simulate a cleanup to see which files and directories would be removed without actually deleting anything
- Backup System: Automatically or manually back up shader caches to a location of your choice before deletion for easy recovery
- Real-time Progress: A live progress bar and status updates keep you informed during the cleanup process
- Detailed Statistics: Get real-time stats on files and directories deleted, total space freed, and any errors encountered
- Comprehensive Scanning: The tool automatically detects known cache locations for:
- NVIDIA (DXCache, GLCache, NV_Cache)
- AMD (DxCache, GLCache)
- Intel
- Steam
- Unreal Engine
- Unity
- And other common Windows cache locations
- Custom Path Support: Easily add your own custom directories to be included in the cleanup scan via the Settings menu
- Advanced Settings: Configure auto-backups, detailed logging, and manage custom paths. All settings are saved automatically
- Enhanced Logging: A detailed log panel shows every action the application takes, with color-coded log levels for clarity
- Stop Functionality: Safely cancel an ongoing cleanup operation at any time
git clone https://github.com/PatrickJnr/Shader-Cache-Remover.git
cd Shader-Cache-Remover- Python 3.8 or higher
- Windows (primary support) or Unix-like systems
- Tkinter (usually included with Python)
# From the repository root
python shader_cache_remover/main.py# From the repository root
python remove_shader_cache.pycd shader_cache_remover
pip install -e .
shader-cache-remover- Start Cleanup: Click this to begin deleting all detected shader cache files. If auto-backup is enabled in Settings, a backup will be created first.
- Dry Run: Click this to perform a simulation. The log will show you everything that would be deleted, but your files will not be touched.
- Backup Shaders: Click this to create a one-time backup of all detected shader caches to a directory you specify.
- Stop: Click this button to safely interrupt any ongoing operation.
- Click the Settings button to open the configuration window.
- Here you can:
- Enable or disable auto-backups before a cleanup.
- Set a default backup location.
- Add, edit, or remove custom directories to be scanned.
- Toggle detailed logging and the progress bar visibility.
- Your settings are saved automatically when you click "Save Settings".
The application automatically creates a configuration file at:
- Windows:
%USERPROFILE%\.shader_cache_remover_config.json - Unix:
$HOME/.shader_cache_remover_config.json
- Auto-backup before cleanup
- Custom shader cache paths
- Progress bar visibility
- Detailed logging level
- Backup location
- NVIDIA:
AppData/Local/NVIDIA/DXCacheandGLCache - AMD:
AppData/Local/AMD/DxCacheandGLCache - Intel:
AppData/Local/Intel/ShaderCache - Unity:
AppData/LocalLow/Unity/Caches - Unreal Engine:
AppData/Local/UnrealEngine/ShaderCache - Steam: Registry-detected Steam shadercache directory
Users can add custom shader cache directories through the settings dialog.
- Dry Run Mode: Preview all operations before execution
- Backup Support: Optional automatic backups with timestamps
- Confirmation Dialogs: User confirmation for critical operations
- Error Recovery: Graceful handling of file system errors
- Progress Feedback: Real-time status updates
The application provides detailed statistics including:
- Files deleted
- Directories removed
- Space freed (human-readable format)
- Errors encountered
- Operation duration
- Backup status
This version features a completely refactored modular architecture that improves upon the original monolithic script:
- Modular Design: Clean separation of concerns with dedicated services
- Better Maintainability: Each component can be modified independently
- Enhanced Testability: Services can be unit tested in isolation
- Improved Extensibility: Easy to add new features or modify existing ones
- Better Error Handling: Comprehensive exception handling throughout
shader_cache_remover/
βββ core/ # Business logic services
β βββ detection_service.py # Finds shader cache directories
β βββ cleanup_service.py # Handles file removal & progress
β βββ backup_service.py # Manages backup operations
βββ infrastructure/ # Supporting services
β βββ config_manager.py # Configuration management
β βββ registry_utils.py # Windows registry operations
β βββ logging_config.py # Centralized logging
βββ gui/ # User interface components
β βββ main_window.py # Main application window
β βββ settings_dialog.py # Settings management dialog
βββ main.py # Application entry point
βββ setup.py # Package configuration
- Separation of Concerns: Each module has a single responsibility
- Better Error Handling: Comprehensive exception handling
- Enhanced Maintainability: Type hints, proper documentation, clean code
- Improved Extensibility: Easy to add new cache detection methods
- Testable Architecture: Modular design enables unit testing
Run the test suite to verify the modular architecture:
python shader_cache_remover/test_modular.py- Administrative Privileges: For best results, run the script with administrative privileges. This ensures it has the necessary permissions to access and delete system-level cache files.
- Disk Space: Be mindful of disk space if you use the backup feature, as shader caches can sometimes be several gigabytes in size.
- Migration: The new modular version is fully backward compatible with existing configurations.
If you're migrating from the original monolithic script:
- The new version is backward compatible in terms of functionality
- Configuration is automatically migrated on first run
- All existing features are preserved and enhanced
- The modular structure provides better maintainability
Contributions are welcome! The modular architecture makes it easy to:
- Add new cache detection methods
- Implement platform-specific optimizations
- Enhance the user interface
- Add new backup strategies
- Improve error handling
For support, feature requests, or bug reports:
- Create an issue on GitHub
- Check the existing documentation
- Review the changelog for recent updates
