Copy AI for VS Code

Seamlessly Share Code with AI Assistants
Copy AI is a streamlined VS Code extension that lets you instantly share your code with AI assistants like ChatGPT, Claude, GitHub Copilot, and more. With just one click, prepare your code in an AI-friendly format that maximizes the value of your token usage.
Features
🚀 One-Click Code Sharing
- Copy Current File - Share the active file with your AI assistant
- Copy Open Files - Share all open editor tabs in one go
- Copy All Files - Intelligently share your entire project (respects .gitignore)
- Copy Context Files - Define specific file patterns to share
✨ Token Optimization
- Comment Removal - Automatically strips comments to save tokens
- Whitespace Normalization - Condenses extra whitespace
- Token Estimation - Shows approximate token count for copied content
📋 Customizable Templates
- Create Templates - Define custom pre/post-prompts for your AI interactions
- Template Manager - Manage all your templates from the sidebar
- Apply On-the-Fly - Choose templates when copying code
🧩 Project Context Definition
- Define Contexts - Create custom file groups in
copyai.json
- Quick Access - Access contexts directly from the status bar
Installation
- Open VS Code
- Search for "Copy AI" in the Extensions view
- Click Install
- Enjoy streamlined AI code sharing!
Usage
Basic Usage
The extension adds several buttons to your status bar for quick access:
- Copy Current File - Copies the active file
- Copy Open Files - Copies all open files
- Copy All Files - Copies all files in workspace
- Copy Context - Appears when a
copyai.json
file is present
You can also right-click on files in Explorer to access the context menu options.
Templates
- Access the Templates panel from the activity bar
- Click the "+" icon to create a new template
- Define your pre-prompt and post-prompt text
- Give your template a name
- Select your template when copying code
Contexts
Create a copyai.json
file in your workspace root:
{
"contexts": [
{
"name": "Frontend Components",
"description": "React component files",
"files": ["src/components/**/*.jsx", "src/components/**/*.tsx"]
},
{
"name": "API Routes",
"description": "Backend API endpoints",
"files": ["src/api/**/*.js", "src/pages/api/**/*.js"]
}
]
}
Why Copy AI?
- Save Tokens - Optimized code sharing means more meaningful AI interactions
- Save Time - No more manual copying and formatting of multiple files
- Stay Organized - Templates and contexts keep your AI interactions consistent
- Work Smarter - Focus on solving problems, not on preparing your code for AI