Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Copy AINew to Visual Studio Code? Get it now.
Copy AI

Copy AI

Jean-Baptiste Vanhems

|
747 installs
| (2) | Free
Easily copy code to your favorite AI assistant with one click
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy AI for VS Code

Version Installs License: MIT

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

  1. Open VS Code
  2. Search for "Copy AI" in the Extensions view
  3. Click Install
  4. 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

  1. Access the Templates panel from the activity bar
  2. Click the "+" icon to create a new template
  3. Define your pre-prompt and post-prompt text
  4. Give your template a name
  5. 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
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft