
Tree: Copy File Tree as Text
Right-click a folder in the Explorer and choose Copy File Tree. Paste your project structure into a README, an issue, a pull request or an AI chat.
my-app/
├── src/
│ ├── lib/
│ │ └── util.ts
│ └── index.ts
├── .gitignore
└── package.json
2 folders, 4 files
Features
- Respects
.gitignore at every level, including !negations, plus .git/info/exclude, files.exclude and an optional .treeignore file. node_modules and .git are always skipped.
- Six formats: box-drawing tree, ASCII tree, Markdown code block, nested Markdown list, JSON and a plain path list.
- Copy File Tree As… asks for format, depth and folders-only for a one-off copy.
- Select several items in the Explorer to copy a tree of just those, under their common folder.
- Depth limit, folders only, compact folder chains (
src/main/java/) and max entries per folder (… 120 more).
- Sizes and file counts per folder, and a
N folders, M files summary.
- Token estimate in the confirmation, so you know how much of an AI context window the tree uses.
- Preview the tree in an editor tab, or insert it at the cursor (Markdown files get a code block).
- Works in remote and virtual workspaces. Large folders stop at a safety limit you can raise.
Commands
| Command |
Where |
| Copy File Tree |
Explorer right-click, Command Palette |
| File Tree › Copy File Tree As… |
Explorer right-click |
| File Tree › Copy Folder Tree (folders only) |
Explorer right-click on a folder |
| File Tree › Preview File Tree |
Explorer right-click |
| Insert File Tree at Cursor |
Command Palette |
| Copy Workspace File Tree |
Command Palette |
Settings
| Setting |
Default |
|
hexhad.tree.format |
unicode |
unicode, ascii, markdown, markdownCode, json, paths |
hexhad.tree.maxDepth |
0 |
Folder levels to include (0 = all) |
hexhad.tree.respectGitignore |
true |
Use .gitignore, .git/info/exclude, .treeignore |
hexhad.tree.useFilesExclude |
true |
Also skip what files.exclude hides |
hexhad.tree.exclude |
node_modules, .git, … |
Always skip these (gitignore syntax) |
hexhad.tree.foldersFirst |
true |
Folders before files |
hexhad.tree.showSizes / showCounts |
false |
File sizes, files per folder |
hexhad.tree.compactFolders |
false |
Join single-child folder chains |
hexhad.tree.maxEntriesPerFolder |
0 |
Cap entries per folder (0 = no cap) |
hexhad.tree.summary |
true |
Add N folders, M files |
hexhad.tree.icons |
none |
emoji adds 📁 / 📄 |
hexhad.tree.maxEntries |
20000 |
Stop scanning after this many entries |
Privacy
Works offline. No telemetry, no network requests.
MIT © 2026 HEXHAD. Third-party licenses: THIRD_PARTY_NOTICES.md.
| |