Skip to content

Organize files into persistent, cross-directory virtual groups for better navigation and AI context in VS Code.

License

Notifications You must be signed in to change notification settings

winterdrive/VirtualTabs

Repository files navigation

VirtualTabs – VS Code Extension for Virtual Tabs & Custom File Grouping

Visual Studio Marketplace Version Installs Rating AI-Ready Context

繁體中文 | English

VirtualTabs - VS Code File Grouping and AI Context Extension


πŸš€ What is VirtualTabs?

VirtualTabs is a VS Code extension that provides custom "Virtual File Directories" outside of your native file system. Unlike standard directories, VirtualTabs helps you create independent logical file groups based on your current development theme, while also providing AI-Ready Coding Context for quick copying. It is perfectly suited for Monorepo projects or large-scale applications using MVVM or MVC architectures.


⚑ VirtualTabs vs. Native VS Code Tabs

Feature Native VS Code Tabs VirtualTabs Extension
Persistence Cleared on session close Saved permanently per workspace
Grouping Folder-based only Logic-based (Cross-directory support)
AI Context Hard to gather manually One-click context generation for LLMs

🧩 Solving Modern Workflow Pain Points

In MVC/MVVM or large-scale projects, related files are often scattered across deep directory structures, making switching a repetitive chore:

❌ Traditional File Structure:
β”œβ”€β”€ config.json          (Root Config)
β”œβ”€β”€ styles/theme.css     (Style Layer)
β”œβ”€β”€ src/components/      (View Layer)
β”œβ”€β”€ tests/__tests__/     (Testing Layer)

βœ… Theme-Based Virtual Directory:
πŸ“ Feature: Theme System
  β”œβ”€β”€ πŸ“πŸ“š Configuration
  β”‚   └── config.json
  β”œβ”€β”€ πŸ“πŸ“š Style Definitions
  β”‚   └── theme.css
  β”œβ”€β”€ πŸ“πŸ“š Components (View Layer)
  β”‚   └── ThemeProvider.tsx
  β”‚     └── πŸ”– Line 45: Context setup
  └── πŸ“πŸ“š Unit Tests (Logic/Testing)
  β”‚   └── theme.test.ts

πŸ€– Born for AI Collaboration

In the era of Copilot and LLMs, precise context is the key to high-quality results:

  • Curated Selection: Create groups with only the files relevant to your current task.
  • One-Click Export: Convert entire groups into AI-friendly Markdown blocks (v0.3.0).
  • Reduced Noise: Isolate core logic to help AI focus and prevent hallucinations.
  • Persistent Context: Your curated AI prompts and file sets stay ready even after a restart.

"VirtualTabs helps me define the exact boundary of what the AI should see."


✨ Key Features

Core Capabilities

  • πŸ“ Cross-Directory Grouping β€” Organize files from anywhere, breaking free from folder constraints
  • πŸ”– Task-Oriented Bookmarks β€” Mark specific lines of code within your groups for quick navigation (v0.2.0)
  • πŸ“‚ Sub-Groups & Nesting β€” Create hierarchical structures for better organization (v0.3.0)
  • πŸ€– AI Context Export β€” One-click copy all files as LLM-ready context (v0.3.0)
  • ▢️ Script Execution β€” Inline run button for .bat and .exe files (v0.3.2)
  • πŸ’Ύ Portable Config β€” Settings saved to .vscode/virtualTab.json for team sharing (v0.3.2)
  • πŸ”Œ AI Agent Integration (MCP) β€” Connect AI agents (Cursor, Copilot, Claude, Kiro, Antigravity) to manage your groups programmatically via the Model Context Protocol (v0.4.0)

⚑ Workflow Boosters

  • πŸ“‹ Smart Copy Menu β€” Unified copy options for files and groups (v0.3.0)
  • πŸ“ Directory Drag & Drop β€” Drag folders to add all files recursively (v0.3.0)
  • βœ‚οΈ Full Clipboard Operations β€” Cut/Copy/Paste support for files and groups (v0.3.0)
  • ⇡ Group Reordering β€” Easily move groups up and down via context menu (v0.3.2)
  • πŸ“Š Smart Organization β€” Auto-group by extension, date, or sort by various criteria

⚑ Latest Highlights

v0.4.0 brings full AI agent integration β€” let your AI assistant manage VirtualTabs groups directly:

  • πŸ”Œ MCP Server Integration β€” A fully bundled MCP server (dist/mcp/index.js) ships with the extension, exposing 15+ tools for AI agents to create groups, manage files, handle bookmarks, and explore the project.
  • πŸ›‘οΈ Agent Skill Generation β€” One command generates a tailored skill file for your AI tool (Cursor .mdc, or SKILL.md for Copilot, Claude, Antigravity, Kiro). Includes a four-layer safety decision tree and a CRITICAL CONCEPT warning that VirtualTabs groups are purely virtual β€” no files are ever moved on disk.
  • βš™οΈ MCP Config Panel β€” Get ready-to-paste MCP server configuration for your AI tool with a single click.
  • πŸ“¦ Bundled CLI Fallback (vt.bundle.js) β€” A self-contained CLI co-located with each generated skill file provides a last-resort editing path when MCP tools are unavailable.

MCP Configuration in Your IDE β€” Setup for Each AI Agent

Cursor Antigravity (Google) Kiro
Cursor MCP Setup Antigravity MCP Setup Kiro MCP Setup
Configure MCP in Cursor settings Configure MCP in Antigravity environment Configure MCP in Kiro IDE

Use the MCP Config Panel (command: VirtualTabs: Show MCP Config) to generate ready-to-paste configuration for your chosen AI tool.

v0.3.6 introduced powerful multi-select copy & system improvements:

Copy Menu Demo

  • 🎯 Multi-select Copy Support (Core Update) β€” Select multiple files or groups and copy everything at once.
    • One-click copy for: File Names, Relative Paths, and Absolute Paths.
    • Enhanced "Copy Context for AI" handles mixed selections (files + groups + bookmarks) with automatic content deduplication.
  • 🎨 Smart Unified Menu β€” Replaced redundant menus with a single, intelligent copy submenu.
  • πŸ”§ Enhanced Reliability β€” Implemented robust cycle detection and improved type safety using instanceof checks for smoother performance in large projects.

v0.3.3 enhanced user experience:

  • βš™οΈ Configurable Confirmations β€” Toggle delete confirmation dialogs via settings.
  • 🌍 Better i18n β€” Fully localized messages for English, Traditional Chinese, and Simplified Chinese.

πŸš€ Quick Start

Installation

  1. Open VS Code
  2. Press Ctrl+Shift+X (or Cmd+Shift+X)
  3. Search for VirtualTabs and click Install

First Time Setup

  1. Click the VirtualTabs icon in the Activity Bar (left sidebar)
  2. Right-click in the panel β†’ Create New Group
  3. Drag files from Explorer into your group

πŸ“– User Guide

πŸ“ Group Management

  • Create/Rename: Right-click panel or groups to manage.
  • Sub-Groups: Right-click a group β†’ Add Sub-Group (or drag one group into another) to create nested structures.
  • Auto-Sync: The built-in "Open Editors" group automatically tracks your open tabs.
  • Open/Close All: Includes files in sub-groups recursively.
  • Drag & Drop:
    • Files: Drag files from Explorer into groups.
    • Folders: Drag folders to recursively add all files inside.
    • Multi-select: Hold Ctrl/Cmd to select multiple files to drag at once.

Drag and Drop Demo

πŸ”– Task-Oriented Bookmarks (v0.2.0)

  1. Right-click any line of code β†’ Add Bookmark to VirtualTabs
  2. The bookmark appears nested under the file in your group.
  3. Click to jump instantly to that exact line.
  4. Edit label/description to document why this line is important.

Bookmarks Feature

πŸ€– AI Context Export (v0.3.0)

The "Killer Feature" for LLM workflows.

  1. Setup a group with all relevant files for your current task.
  2. Right-click the group β†’ Copy... β†’ Copy Context for AI.
  3. Paste into ChatGPT/Claude.
    • Smart: Binary files are skipped. Large files (>50KB) are opened for review.
    • Clean: All code is formatted in markdown blocks with file paths.

AI Context Demo

πŸ“‹ Unified Copy Menu

Everything you need in one place. Right-click any file or group:

  • Copy Name/Path: Standard path copying.
  • Copy Context: Get the code content.
  • Multi-select: Select 5 files β†’ Copy Paths β†’ Get a list of 5 paths.

πŸ“Š Sorting & Organization

  • Sort: Right-click group β†’ Sort Files (Name, Path, Extension, Date).
  • Auto-Group: Right-click group β†’ Auto Group by Extension/Date.
  • Reorder: Use Right-click β†’ Move Up/Down to manually order groups.

🎯 Use Cases

  • Monorepo Management: Group related configs and logic across multiple packages.
  • Architecture-Oriented Dev: Organize by logic layers (MVC/MVVM) rather than physical disk paths.
  • AI Context Curation: Build precise file sets for LLMs to maximize prompt accuracy.
  • Code Review (CR): Centralize all changed files for a specific feature for efficient review.
  • Micro-Tutorials: Create curated code paths for onboarding or technical reference.

πŸ’‘ Best Practices

  1. Group by Task, Not Folder: Think about what you're working on, not where files live
  2. Use Sub-Groups: Organize large groups with nested structure (v0.3.0)
  3. Use Bookmarks for Logic Flow: Mark key decision points in your code
  4. Create AI Context Groups: Group 5-10 files for focused AI assistance
  5. Export Before Prompting: Use "Copy Context for AI" before asking LLMs
  6. Review and Refine: Periodically clean up unused groups to stay organized

❓ FAQ

Q1: I don't see the VirtualTabs panel?

Check:

  • The extension is enabled
  • Your VS Code version is 1.75+
  • VirtualTabs has its own icon in the Activity Bar (left sidebar)

Q2: How do I create sub-groups?

Right-click any group β†’ Add Sub-Group. You can also drag a group onto another group to nest it.

Q3: How does "Copy Context for AI" work?

It reads all files in the group (including sub-groups), formats them as markdown code blocks, and copies to clipboard. Binary files are automatically skipped.

Q4: Can I share my groups with my team?

Currently, groups are saved in workspaceState (local) or .vscode/virtualTab.json (shareable). v0.3.2 introduced support for .vscode storage!

Q5: Do bookmarks work across file renames?

Yes! Bookmarks track file paths and will update if you rename files within VS Code.

Q6: How do I drag folders into groups?

Simply drag a folder from the Explorer panel onto a group. VirtualTabs will automatically add all files recursively, skipping the directory entry itself.


🀝 Contributing

We welcome community contributions!

πŸ”§ For Developers

Interested in code contributions? Please check DEVELOPMENT.md for:

  • Environment setup
  • Debugging & publishing guide
  • Module structure
  • Common error troubleshooting

πŸ’¬ Community


🀝 Recommended Companion

πŸ”₯ Quick Prompt

The perfect partner for VirtualTabs.

While VirtualTabs organizes your Context (Files), Quick Prompt organizes your Instructions (Prompts).

  • VirtualTabs: Defines where the AI should look (File Groups).
  • Quick Prompt: Defines what the AI should do (Prompt Management).

Together, they create the ultimate AI-coding workflow.

Get Quick Prompt on VS Code Marketplace | Open VSX Registry


πŸ“… Changelog

πŸ‘‰ See CHANGELOG.md for full release history.

βœ… v0.4.0 (Latest)

  • πŸ”Œ MCP Server β€” Bundled MCP server enabling AI agents to manage groups via the Model Context Protocol
  • πŸ›‘οΈ Agent Skill Generation β€” Generates target-specific skill files for Cursor, Copilot, Claude, Kiro, and Antigravity
  • βš™οΈ MCP Config Panel β€” One-click config snippet for every supported AI client
  • πŸ“¦ Bundled CLI Fallback β€” Self-contained vt.bundle.js as a last-resort editing path when MCP is unavailable

v0.3.6

  • 🎯 Multi-select Copy Support β€” All copy commands now support selecting multiple files/groups
  • 🎨 Unified Copy Menu β€” Consolidated 4 duplicate submenus into one smart menu
  • πŸ”§ Enhanced Reliability β€” Improved type safety with instanceof checks and Set-based cycle detection
  • πŸ› Bug Fixes β€” Fixed command namespace conflicts and bookmark context handling

❀️ Support

If you find this extension helpful, please consider supporting the development!

ko-fi

πŸ“„ License

Licensed under MIT License. Free for personal and commercial use.


Organize smarter, code faster. πŸš€

About

Organize files into persistent, cross-directory virtual groups for better navigation and AI context in VS Code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors