Declutter your VS Code Explorer. Hide ignored and unwanted files with one click.
What it does
Declutter reads your workspace ignore files and injects those patterns into files.exclude so the Explorer only shows you what matters. One click to hide, one click to restore — your pre-existing excludes are never touched.
Usage
Click the Declutter item in the status bar (bottom left):
| State | Appearance | Meaning |
|---|---|---|
| Inactive | ○ Declutter (dim) |
Ignored files are visible |
| Active | ● Declutter (bright) |
Ignored files are hidden |
Settings
| Setting | Default | Description |
|---|---|---|
declutter.configTarget |
"workspace" |
Where to write files.exclude — "workspace" (.vscode/settings.json) or "global" (user settings, no git noise) |
declutter.includeNestedIgnoreFiles |
false |
Also scan ignore files in subdirectories, not just the workspace root |
declutter.autoHideOnOpen |
false |
Automatically activate hiding when a workspace is opened |
declutter.showNotifications |
true |
Show info messages when toggling visibility on or off |
declutter.additionalPatterns |
[] |
Extra glob patterns to hide in addition to those from ignore files |
Example: additional patterns
"declutter.additionalPatterns": [
"**/TODO.md",
"**/*.bak"
]
How it works
- On hide: reads .gitignore files (and optionally nested .gitignore files), converts patterns to VS Code glob syntax, merges with
additionalPatterns, and writes them tofiles.exclude - On show: removes only the patterns Declutter added — any excludes you had before are left as they were
Pattern conversion rules
| Pattern | VS Code glob | Notes |
|---|---|---|
*.log |
**/*.log |
No slash — matches anywhere in tree |
/dist |
dist |
Leading / — root-relative |
node_modules/ |
**/node_modules |
Trailing / — directory marker, matches anywhere |
src/generated/ |
src/generated |
Contains slash — path-specific |
# comment |
(skipped) | Comments ignored |
!important.log |
(skipped) | Negations have no files.exclude equivalent |
For nested .gitignore files, patterns are scoped to their directory:
| File | Pattern | VS Code glob |
|---|---|---|
packages/alpha/.gitignore |
build/ |
packages/alpha/**/build |
out/generated/.gitignore |
*.map |
out/generated/**/*.map |
Notes
configTarget: "workspace"writes to.vscode/settings.json— this will appear as a diff in shared repos. Use"global"to avoid that.- Negation patterns (
!pattern) are silently skipped —files.excludehas no equivalent. - If you manually remove a pattern from
files.excludewhile Declutter is active, toggling off will skip it without error.