Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Empty Folders RemoverNew to Visual Studio Code? Get it now.
Empty Folders Remover

Empty Folders Remover

lirik

|
313 installs
| (0) | Free
VS Code extension to remove empty folders
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Empty Folders Remover

A simple and efficient Visual Studio Code extension that helps maintain cleanliness in your projects by finding and removing empty folders.

Features

  • 🔍 Recursive search for empty folders in your project
  • 🗑️ Automatic removal of found empty directories
  • 🧹 Cascade removal: removes entire chains of empty folders (children → parents)
  • 🧽 Ignores OS junk files (.DS_Store, Thumbs.db, desktop.ini): folders containing only them are treated as empty (configurable via emptyFoldersRemover.junkFiles)
  • 📁 Multi-root workspace support: processes all folders in your workspace
  • 🖱️ Explorer context menu: right-click a folder to clean only that folder
  • ♻️ Removed items go to the OS trash by default (configurable via emptyFoldersRemover.useTrash)
  • 📊 Display of removed folders count
  • ⚡ Quick execution via command palette
  • 🛡️ Safe operation with error notifications

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Empty Folders Remover"
  4. Click Install

Usage

  1. Open your project folder in VS Code
  2. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  3. Type "Remove Empty Folders"
  4. Press Enter

After execution, the extension will show the number of empty folders removed.

Requirements

  • Visual Studio Code version 1.96.0 or higher

Safety Notes

  • The extension only removes completely empty folders (OS junk files like .DS_Store don't count as content and are deleted with the folder)
  • Removed folders and junk files are moved to the OS trash by default, so they can be restored (set emptyFoldersRemover.useTrash to false for permanent deletion, e.g. on remote file systems without trash support)
  • Workspace root folders are never removed, including nested roots in multi-root workspaces
  • Junk file patterns without literal characters (such as * or *.*) are ignored to prevent accidental data loss
  • Folders containing hidden files (like .gitkeep) are not considered empty and won't be removed
  • The extension is disabled in untrusted workspaces (Workspace Trust)

How it works

The extension performs a recursive scan of your project directory. A folder is considered empty if it contains no files and all of its subfolders are empty. Empty folders are removed in a safe order from deepest to parent to avoid conflicts.

Contributing

Contributions are welcome! Feel free to submit issues and pull requests on our GitHub repository.

License

This extension is released under the MIT License.

Support

If you encounter any issues or have suggestions for improvements, please open an issue on our GitHub repository.


Enjoy cleaner projects! 🚀

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft