This Visual Studio Code extension allows you to copy the content of all opened tabs into a new tab or directly to your clipboard, including their file locations. It's a powerful tool for various use cases, especially when working with AI code assistants or needing to share your codebase context.
Effortlessly compile and share your entire project context with this powerful VS Code extension. Perfect for AI-assisted coding, code reviews, documentation, and teaching.
Streamline your workflow and enhance collaboration by quickly sharing your codebase context. Ideal for use with AI code assistants, team code reviews, and more!
- Copy tabs content to a new tab or directly to clipboard
- Copy all opened tabs or selectively copy chosen tabs
- Custom formatting option for copied content
- Includes a structured file tree for better context
- Includes the file location at the top of each file's content
- Preserves the order of the tabs as they appear in your editor
- Adds convenient status bar items for quick access (customizable)
- Configurable file type inclusion/exclusion
- Option to include or exclude comments
- Customizable separator between files
- Keyboard shortcuts for quick access
- History panel for managing copied content
- Full localization support (English, French, German)
- Beautiful, responsive history interface
-
AI Code Assistants: Easily share your entire project context with web-based AI code assistants like ChatGPT or GitHub Copilot. Example: Copy all your project files and paste them into a ChatGPT conversation for in-depth code reviews or refactoring suggestions.
-
Code Reviews: Quickly compile all changed files for a comprehensive code review. Example: Before a pull request, copy all modified files to share with your team for feedback.
-
Documentation: Generate a single-file overview of your project structure and contents. Example: Create a quick project snapshot for documentation purposes or to share with new team members.
-
Debugging: Gather all relevant files when seeking help with a complex bug. Example: Copy all files related to a specific feature to share in a Stack Overflow question or with support.
-
Teaching and Presentations: Easily collect multiple code files for educational purposes. Example: Prepare a coding lesson by copying all relevant example files into a single document.
- Open Visual Studio Code
- Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on macOS)
- Search for "Copy All Tabs to New Tab"
- Click Install
There are four main features, each accessible via the status bar, command palette, or keyboard shortcut:
- Status Bar: Click the "π Clipboard Mode" or "πͺ Tab Mode" item to toggle
- Command Palette: "Toggle Clipboard Mode"
- Keyboard Shortcut:
Ctrl+Alt+Shift+T(Windows/Linux) orCmd+Option+Shift+T(macOS)
- Status Bar: Click on the "π Copy All" item
- Command Palette: "Copy All Tabs to New Tab"
- Keyboard Shortcut:
Ctrl+Alt+Shift+C(Windows/Linux) orCmd+Option+Shift+C(macOS)
- Status Bar: Click on the "β Copy Selected" item
- Command Palette: "Copy Selected Tabs to New Tab"
- Keyboard Shortcut:
Ctrl+Alt+Shift+S(Windows/Linux) orCmd+Option+Shift+S(macOS)
- Status Bar: Click on the "βοΈ Copy Custom" item
- Command Palette: "Copy Tabs with Custom Format"
- Keyboard Shortcut:
Ctrl+Alt+Shift+F(Windows/Linux) orCmd+Option+Shift+F(macOS)
- View Button: Click the π history icon in the activity bar
- Command Palette: "Show History Panel"
- Keyboard Shortcut:
Ctrl+Alt+Shift+H(Windows/Linux) orCmd+Option+Shift+H(macOS)
The History Panel allows you to:
- View your copy history
- Preview copied content
- Re-copy previous items
- Delete individual items
- Clear entire history
- See timestamps for each copy
- Track remaining history slots
You can also access all features through the Command Palette (F1 or Ctrl+Shift+P / Cmd+Shift+P):
Customize the extension behavior through VS Code settings:
When enabled, a structured file tree is included at the top (or bottom) of the copied content, providing a clear overview of your project structure. This feature is especially useful when sharing your codebase with AI assistants or during code reviews.
- Open all relevant files in your VS Code project.
- Enable Clipboard Mode if you want to paste directly into the AI assistant.
- Use the extension to copy all tabs (or selected tabs).
- Open your preferred AI code assistant (e.g., ChatGPT).
- Paste the copied content and ask for code review, optimization suggestions, or any other coding assistance.
This workflow allows you to quickly provide full context to the AI assistant, leading to more accurate and helpful responses.
When copying tabs, you'll now see detailed statistics in the notification:
- β Number of successfully copied files
- βNumber of failed files (if any)
- βList of failed files (if any)
- πTotal token count (useful for AI assistants)
Example notification:
5 Tabs copied to clipboard!-β
Success: 5-π Tokens: 1,234
Or with failures:
3 Tabs copied to clipboard!-β
Success: 3-β Failed: 2-β Files: test.jpg, binary.exe-π Tokens: 567
This extension contributes the following settings:
copytabs.copyToClipboard: Copy tabs content directly to clipboard instead of opening in a new tab (default: false).copytabs.includeFileTypes: File types to include in the copy process. Leave empty to include all files.copytabs.excludeFileTypes: File types to exclude from the copy process.copytabs.separatorLine: The separator line to use between files.copytabs.includeComments: Whether to include comments in the copied content.copytabs.includeLineNumbers: Include line numbers in the copied content.copytabs.includeFileTree: Include a structured file tree in the copied content.copytabs.structuredTreePosition: Position to include the structured file tree (start or end of the document).copytabs.showCopyAllButton: Show the 'Copy All' button in the status bar.copytabs.showCopySelectedButton: Show the 'Copy Selected' button in the status bar.copytabs.showCopyCustomButton: Show the 'Copy Custom' button in the status bar.copytabs.maxFileSize: Maximum file size in bytes to include (default: 5MB = 5242880 bytes).
You can modify these settings in your VS Code settings.json file. For example:
{
"copytabs.copyToClipboard": true,
"copytabs.showCopyCustomButton": false,
"copytabs.maxFileSize": 10485760
}You can customize the keyboard shortcuts for each command. Open the Keyboard Shortcuts editor (Ctrl+K Ctrl+S or Cmd+K Cmd+S on macOS) and search for "copytabs" to modify them.
Example custom keybinding in keybindings.json:
[
{
"key": "ctrl+shift+c",
"command": "copytabs.copyAllTabs"
},
{
"key": "ctrl+shift+s",
"command": "copytabs.copySelectedTabs"
}
]This allows you to customize which buttons appear in your status bar and how the extension behaves, optimizing your workspace according to your needs and preferences.
This extension requires Visual Studio Code version 1.91.0 or higher.
If the keyboard shortcuts are not responding:
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS)
- Search for "Keyboard Shortcuts" and open it
- Search for "copytabs" to see all available commands
- Check if there are conflicting keybindings from other extensions
- You can rebind to different keys by clicking the pencil icon and entering your preferred shortcut
If content is not being copied in clipboard mode:
- Verify that
copytabs.copyToClipboardis set totruein your settings - Check the Output panel (View β Output) and look for the "copytabs" channel
- Ensure you have at least one tab open in the editor
- Try copying to a new tab first (clipboard mode off) to verify the extension is working
If the History view is not visible:
- Look for the "Copy History" icon (π) in the Activity Bar on the left
- If not visible, open the Command Palette and run "Show Copy History"
- You can pin the view by right-clicking the icon and selecting "Pin"
The extension has a configurable file size limit (default: 5MB) to prevent memory issues:
- Check your settings: look for
copytabs.maxFileSize - To include larger files, increase this value (in bytes)
- Be cautious with very large files as they may impact performance
If you see "Output size exceeds 50MB limit" warning:
- Reduce the number of tabs you're copying
- Exclude certain file types using
copytabs.excludeFileTypes - Reduce the maximum file size with
copytabs.maxFileSize
There are no known issues at this time. If you encounter any problems, please file an issue on the GitHub repository.
- Restored file count in copy notifications
- Added token count statistics to notifications
- Added failed files list to notifications for better error tracking
- Added detailed copy statistics:
- Success count
- Failed count
- Total tokens
- Failed files list
- Improved notification format for better readability
- Updated documentation with new notification features
Major update focusing on History management & Localization:
- New History Panel feature:
- Dedicated activity bar view for copy history
- Preview copied content
- Re-copy previous items
- Delete individual history items
- Clear entire history
- Beautiful, responsive UI
- History limit indicator
- Timestamps for all copies
- Full localization support:
- Added French (fr) translation
- Added German (de) translation
- Localized all UI elements
- New keyboard shortcut:
Ctrl/Cmd+Shift+Hto open history panel
Major update focusing on stability and user experience:
- Improved error handling and recovery
- Better progress reporting
- More efficient file processing
- Enhanced clipboard mode
- Better handling of large files
- Improved status bar management
For a full list of changes, please see the CHANGELOG.md file.
Contributions are welcome! Please feel free to submit a Pull Request.
This extension is licensed under the MIT License.
If you find this extension helpful, consider:
- Star the repository on GitHub
- Leave a review on the VS Code Marketplace
- Report any issues or suggest features on the GitHub repository
π‘ Try it now and supercharge your coding experience!
Thank you for using Copy All Tabs to New Tab!




