Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>File Explorer FilterNew to Visual Studio Code? Get it now.
File Explorer Filter

File Explorer Filter

Hong LMN

|
38 installs
| (0) | Free
Instantly filter the VS Code Explorer tree by file name and optional folder scope (full path, relative path, or folder name) - matching folders auto-expand, everything else hides, including empty folders.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

File Explorer Filter

Filter the VS Code Explorer down to the files you need — and hide everything else.

In a large repo, the Explorer is a long scroll of packages, generated trees, and empty folders. Search finds files, but it does not reshape the tree. File Explorer Filter does: type a name, paste a list, or pin a folder, and the Explorer collapses to matching files only. Matching folders open on their own. Empty folders disappear.

Built for monorepos, multi-root workspaces, and enterprise codebases where clicking through the tree is slower than the work itself.


What it does

A persistent Filter box sits at the top of Explorer.

  • Match by file name, wildcard, or a pasted list
  • Optionally limit results with Folder Scope (full path, relative path, or folder name)
  • Hide every folder that contains no match — including empty ones
  • Auto-expand the path to every result
  • Mark matches in the tree and show a live count in the status bar
  • Restore your Explorer and files.exclude settings the moment you clear

You stay in Explorer. No extra search panel, no Quick Open round-trip, no manual expand/collapse.

Why it is faster than navigating Explorer by hand

Without File Explorer Filter With File Explorer Filter
Expand src → modules → billing → services to reach one file Type invoice.service.ts, press Enter
Scroll past node_modules, dist, and empty legacy folders Those folders are hidden while the filter is on
The same Header.tsx exists in web, admin, and ui Folder Scope components keeps only the one you mean
A PR lists 12 files; you hunt for each Paste the list; the tree is those 12 files

The filter is a temporary lens. Open editors, layout, and your own exclude settings are left alone.


Who it is for

  • Large / enterprise repos — thousands of files, generated code, deep module trees
  • Monorepos — apps/, packages/, services/ with repeated folder names
  • Multi-root workspaces — several roots in one window; scope to one root or package without emptying the others
  • Reviews and tickets — jump to the files named in a PR, incident, or deploy package

Features

File name matching (auto-detected)

You type Result
invoice.service.ts Substring match — any file whose name contains that text
invoice.service.ts\|payment.service.ts Exact match on each listed name
One name per line (paste from a PR) Same as a pipe-separated list
*.spec.ts or Account?.cs Wildcard (* and ?)

Folder Scope

Hidden until you need it. Click ... under the File Name box (tooltip: Toggle Folder Scope).

Each line is one scope. A file is kept if it sits in any of them.

You type Meaning
/Users/me/work/billing-api/src or C:\work\billing-api\src Full path
packages/billing or billing-api/src Relative workspace path (or rootName/… in multi-root)
billing or services Folder name — any parent folder or workspace root with that name

Use name and scope together, or either one alone.

Explorer behavior

  • Matching folders auto-expand
  • Folders with no match are hidden, not left empty
  • Matches show a ● decoration
  • Your files.exclude is captured once and restored on clear
  • Names containing [ or ] are escaped so they are not treated as glob syntax

History and input

  • Last 10 file-name patterns per workspace — ↑ / ↓ or the Recent list
  • Last 10 folder scopes — ↑ / ↓ in the Folder Scope box (no extra list)
  • Multi-line text areas; paste a list and press Enter once
  • Draft, history, and an active filter survive hiding Explorer (Ctrl+B) and window reloads

Usage

Open Explorer (Ctrl+Shift+E / Cmd+Shift+E). The Filter box is above the tree.

File name

invoice.service.ts

Shows every file whose name contains invoice.service.ts — for example src/billing/invoice.service.ts.

invoice.service.ts|payment.service.ts|refund.service.ts

Exact match on those three names, anywhere in the workspace.

*.spec.ts

Every *.spec.ts file.

Paste from a ticket or PR (one name per line), then press Enter:

CustomerService.cs
OrderService.cs
InvoiceController.cs

Folder Scope

Click ... (right side, under File Name).

Full path — only files under that directory:

/Users/me/work/contoso/src/Billing

Relative path — a package or module from the workspace root:

packages/billing-api

Folder name — any folder (or root) named services:

services

Several scopes (one per line) — files in either place:

packages/billing-api
packages/payments

Name + scope — Header.tsx only inside components, not packages/ui/src/Header.tsx:

File Name:    Header.tsx
Folder Scope: components

Leave File Name empty to show every file inside the scope (for example the whole deploy/linux package).

Keyboard

Key File Name / Folder Scope
Enter Apply (both fields together)
Shift+Enter New line, do not apply
Enter on empty File Name and empty Folder Scope Clear the filter
↑ at the start of the box Older history item
↓ at the end of the box Newer item / current draft

Recent file-name history

The last 10 file-name patterns appear under the box:

  • Click a row to apply it again (current Folder Scope is kept)
  • Click ✕ to drop one entry
  • Click Clear all to wipe file-name history

Folder Scope history is only recalled with ↑ / ↓ in that box.


Status bar

A persistent item on the left of the status bar:

Indicator Meaning
FILTER IDLE No filter applied
N FILE / N FILES Filter on; match count
0 FILE Applied, but nothing matched (Explorer is left unfiltered)
FILTER CLEARED Filter just cleared; full tree restored

Commands

Command ID Description
File Explorer Filter: Set Pattern file-explorer-filter.setFilter Focus the Filter box from anywhere
File Explorer Filter: Clear file-explorer-filter.clearFilter Clear the filter and restore Explorer

Bind a shortcut: Keyboard Shortcuts (Ctrl+K Ctrl+S / Cmd+K Cmd+S) → search “File Explorer Filter”.

The Set Pattern command focuses the same box you use with the mouse, so paste, history, and Enter behave identically.


Installation

  1. Open Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  2. Search for File Explorer Filter
  3. Install
code --install-extension honglmn.file-explorer-filter

Requirements: VS Code 1.74.0 or later. No extra dependencies. No settings required.


How it works

The extension scans the workspace, matches names (and Folder Scope, if set), then updates files.exclude so only matches and their parent folders stay visible.

Exclude keys are always relative to the file’s own workspace folder. In a multi-root window, Folder Scope writes those excludes per root, so a match under billing-api cannot leave web-app looking empty. Clearing the filter writes your original excludes back. Nothing is stored as a permanent project setting beyond that restore.


Support

Bugs and requests: GitHub issues.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft