CleanWorkingFiles is a lightweight .NET console application for cleaning up automatically generated build and cache directories in .NET and frontend projects. It helps reclaim disk space by deleting folders like bin, obj, node_modules, and other build artifacts or cache files that are safe to remove.
- Reads configuration from a local config.json file (located next to the executable).
- Recursively scans the specified root directory.
- Deletes:
- Directories listed in directoriesToDelete (e.g., bin, obj, node_modules).
- Files matching extensions from extensionsToDelete (e.g., .log, .tmp).
- Skips paths defined in excludePaths.
- Shows a preview of all planned deletions before executing.
- Requires explicit confirmation (YES) before removing anything.
- Displays live progress while scanning and deleting.
Example configuration file:
{
"root": "C:\\Projects\\old",
"directoriesToDelete": [
"bin", "obj", "node_modules", "dist", "build",
".vs", ".idea", "_ReSharper.Caches", ".angular", ".next"
],
"extensionsToDelete": [
".log", ".tmp", ".cache"
],
"excludePaths": [
"C:\\Projects\\old\\MySpecialProject",
"C:\\Projects\\old\\Legacy\\DoNotTouch"
]
}- root -> the starting directory for the scan.
- directoriesToDelete -> directory names to remove (matches by name, anywhere in the tree).
- extensionsToDelete -> file extensions to remove (with or without dot).
- excludePaths -> full paths that should be ignored (including their files and subdirectories).
- The tool never deletes without showing a full preview. Check carefully everything it would delete before confirmation!
- You must type YES to confirm deletions.
- Keep excludePaths up to date to protect sensitive directories.