Copy code, files, or entire projects with full context for ChatGPT, Claude, and other AI tools.
VS Code extension to copy codebase for AI with file paths, structure, and token count.
🔍 Keywords (for search)
copy code to chatgpt, vscode chatgpt extension, copy project for ai, copy folder as markdown, token counter vscode, prepare code for ai prompt, claude code context, llm prompt helper
💡 What this extension does
Copy for AI helps you quickly prepare your code for AI tools like ChatGPT and Claude.
Instead of manually copying files, you can:
- Copy code with file path and line numbers
- Copy entire folders as Markdown
- Copy project structure (tree view)
- See token count before sending to AI
- Format output for LLM prompts
✨ Features
📋 Copy code with context (ChatGPT-ready)
- Includes file path + line numbers
- Perfect for debugging and explaining code with AI
📁 Copy folder as Markdown
- Export multiple files into a single AI-friendly prompt
- Useful for:
- ChatGPT
- Claude
- LLM tools
🌳 Copy project structure (tree)
- Quickly show your codebase layout to AI
- Helps AI understand relationships between files
🔢 Token counter (LLM ready)
- Estimate token usage before sending
- Avoid exceeding ChatGPT / Claude limits
🎨 Output formats for AI
- Markdown (recommended for ChatGPT)
- Plain text
- XML
🚫 Exclude unnecessary files
- Ignore:
- node_modules
- .git
- dist
- logs
- Custom glob patterns supported
⚡ Quick access to AI tools
- Open ChatGPT, Claude, Perplexity in one click
🧠 Smart Fit (AI‑optimized context)
Automatically selects the most relevant files and their dependencies to fit within your AI token limits.
- Importance scoring – prioritizes files that matter most (types, configs, core logic)
- Dependency graph – keeps code connected, so AI understands your project
- Hybrid mode – combines importance + dependencies for the best possible context
- One click – no more manual trimming, just copy folder and choose Smart Fit
🧠 Use cases
- Debug code with ChatGPT
- Send full project context to Claude
- Generate documentation with AI
- Refactor code using LLMs
- Share structured code snippets
🛠 How to use
Copy code to ChatGPT
Select code → Right click → Copy Code for AI
Copy folder for AI
Right click folder → Copy Folder for AI
Copy project structure
Right click → Copy Project Structure
⚙️ Settings
Copy for AI settings:
-
copyForAI.excludePatterns
Exclude files/folders (glob patterns) -
copyForAI.outputFormat
markdown | plain | xml
📥 Installation
VS Code Marketplace
Search: copy code to chatgpt or copy for ai
Manual install (.vsix)
- Download from Releases
- Install via VS Code
💙 Support
If this extension helps you save time:
📄 License
MIT