Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Folder StructureNew to Visual Studio Code? Get it now.
Copy Folder Structure

Copy Folder Structure

Ogulcan Bayter

|
2 installs
| (0) | Free
Right-click a folder to copy its structure as a tree diagram to clipboard
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Folder Structure

A VS Code extension that generates a tree-style ASCII representation of folder structures and copies it to your clipboard.

Features

  • Right-click any folder in the Explorer to copy its structure
  • Generates clean, tree-style ASCII output similar to the UNIX tree command
  • Automatically ignores common build artifacts and dependencies
  • One-click operation with clipboard integration

Usage

  1. Right-click any folder in the VS Code Explorer
  2. Select "Copy Folder Structure" from the context menu
  3. Paste the result anywhere you need it

Example Output

Default Output

.
├─ src
│  ├─ components
│  │  ├─ Button.tsx
│  │  └─ Input.tsx
│  ├─ utils
│  │  └─ format.ts
│  └─ index.ts
├─ tests
│  └─ unit.test.ts
├─ node_modules (excluded)
└─ package.json

With Excluded Folders Hidden

If you set showExcludedFolders to false, excluded folders won't appear at all.

Configuration

You can customize which folders to exclude and how they appear. Open VS Code settings (Cmd+, on Mac, Ctrl+, on Windows/Linux) and search for "Copy Folder Structure".

Available Settings

copyFolderStructure.excludePatterns

Array of folder/file names to exclude from the tree.

Default:

[
  "node_modules",
  ".git",
  "dist",
  "build",
  "out",
  ".vscode",
  ".DS_Store",
  "coverage",
  ".cache"
]

Example: To also exclude android and ios folders:

"copyFolderStructure.excludePatterns": [
  "node_modules",
  ".git",
  "dist",
  "build",
  "out",
  ".vscode",
  ".DS_Store",
  "coverage",
  ".cache",
  "android",
  "ios"
]

copyFolderStructure.showExcludedFolders

Show excluded folders with a marker instead of hiding them completely.

Type: boolean Default: true

Example:

"copyFolderStructure.showExcludedFolders": false

copyFolderStructure.excludedFolderMarker

Text to append to excluded folder names (only used when showExcludedFolders is true).

Type: string Default: " (excluded)" Options:

  • " (excluded)"
  • "..."
  • " [excluded]"
  • " - excluded"

Example:

"copyFolderStructure.excludedFolderMarker": "..."

This would show: android... instead of android (excluded)

Common Use Cases

React Native Projects

To exclude large native folders:

"copyFolderStructure.excludePatterns": [
  "node_modules",
  ".git",
  "dist",
  "build",
  "out",
  ".vscode",
  ".DS_Store",
  "coverage",
  ".cache",
  "android",
  "ios"
]

Hide Excluded Folders Completely

To make the output cleaner by not showing excluded folders at all:

"copyFolderStructure.showExcludedFolders": false

Change the Marker Style

To use a more compact marker:

"copyFolderStructure.excludedFolderMarker": "..."

Output: android... instead of android (excluded)

Installation

From VSIX (Local Installation)

  1. Download the .vsix file
  2. Open VS Code
  3. Go to Extensions (Ctrl+Shift+X or Cmd+Shift+X)
  4. Click the "..." menu at the top
  5. Select "Install from VSIX..."
  6. Choose the downloaded file

From Marketplace (When Published)

Search for "Copy Folder Structure" in the VS Code Extensions marketplace.

Development

Setup

npm install

Build

npm run compile

Watch Mode

npm run watch

Testing

  1. Open this project in VS Code
  2. Press F5 to launch the Extension Development Host
  3. In the new window, open a folder with subfolders
  4. Right-click a folder and select "Copy Folder Structure"
  5. Verify the tree structure is copied to your clipboard

Package

npm run package

This creates a .vsix file that can be installed locally or published to the marketplace.

Requirements

  • VS Code 1.75.0 or higher

Known Issues

None at this time. Please report issues on the GitHub repository.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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