Copy Files to Clipboard is a VS Code extension that allows you to quickly gather and copy the contents of multiple files and entire directories directly to your clipboard.
The copied text is automatically formatted into Markdown.
✨ Features
Multi-Select & Folders: Right-click a single file, multiple selected files, or an entire folder in the VS Code Explorer to copy their contents at once.
Markdown Formatted Output: Files are automatically prepended with their relative path and wrapped in language-specific syntax highlighting blocks.
Smart Code Fences: Automatically calculates the number of backticks needed for code blocks, ensuring that copying Markdown files with existing code blocks never breaks the formatting.
Smart Filtering: Automatically detects and skips non-text/binary files to prevent clipboard bloat.
Security First: Built-in safeguards skip sensitive files (like .env, .pem, and .key files) to prevent accidentally sharing secrets.
Safeguards: Implements customizable limits on file size, total payload size, file count, and directory depth to prevent VS Code from freezing on massive directories (like node_modules).
🚀 Usage
Open the VS Code Explorer.
Select one or more files, or an entire folder.
Right-click to open the context menu.
Select "Copy Files to Clipboard".
Paste your formatted code anywhere!
Output Example
When you copy files, they are formatted in your clipboard like this: