A Visual Studio Code extension that streamlines the process of selecting and extracting code files and directories for use in Large Language Model (LLM) chat interfaces. Context Clipboard integrates seamlessly with VS Code's explorer view, providing an intuitive way to manage and format code context for LLM interactions.
Features
📁 Visual File Selection: Easily select multiple files and directories directly from VS Code's explorer view
🎯 Smart Context Management: Exclude irrelevant files and directories to maintain focused context
📊 Token Tracking: Monitor token consumption with real-time feedback using js-tiktoken
⚡ Performance Optimized: Efficiently handles large codebases with asynchronous processing
🔄 Universal Compatibility: Supports all file types that VS Code can open
🎨 Native Integration: Follows VS Code's UI patterns for a seamless experience
Installation
Open VS Code
Press Ctrl+P / Cmd+P to open the Quick Open dialog
Type ext install context-clipboard
Press Enter
Usage
Open your project in VS Code
In the explorer view, use the checkbox icons to select files and directories
Monitor token usage in real-time as you select files
Click the "Copy Context" button in the explorer view toolbar
Paste the formatted content into your preferred LLM chat interface
Extension Settings
This extension contributes the following settings:
contextClipboard.maxTokens: Maximum number of tokens to include in copied context
contextClipboard.excludePatterns: Glob patterns for files to exclude from selection
contextClipboard.formatTemplate: Custom template for context output formatting
contextClipboard.tokenModel: Token counting model to use (default: 'gpt-4o')