AI Code Bridge - VSCode Extension
A VSCode extension that helps you work with AI assistants like Claude and ChatGPT. Export your code, get AI suggestions, and import changes safely with visual preview.
🎯 What Does It Do?
Export → Send code to AI → Get improvements back → Import with preview → Accept/Reject changes
📦 Installation
- Download the 
.vsix file 
- In VSCode: 
Ctrl+Shift+P → "Extensions: Install from VSIX" 
- Select the file and reload VSCode
 
🚀 How to Use
Step 1: Export Your Code
Right-click any file/folder → "Export to AI Snapshot"
- Select a prompt template (default, refactor, feature, bugfix, etc.)
 
- A 
.md file is created in .agent/ folder 
- Content is automatically copied to clipboard
 
Step 2: Send to AI
Paste the content into:
- Claude (claude.ai)
 
- ChatGPT (chat.openai.com)
 
- Any AI assistant
 
Tell the AI what you want:
- "Refactor this code"
 
- "Add error handling"
 
- "Fix security issues"
 
- "Add documentation"
 
Step 3: Import AI Changes
Click the AI Code Bridge icon in the left sidebar
Import Tab:
- Paste the AI's JSON response
 
- Click "Import from Text"
 
- Preview each change side-by-side
 
- Click Accept ✓ or Reject ✗ for each file
 
- Use Stage Block to git stage approved changes
 
Buttons available:
- Previous/Next Change (navigate)
 
- Stage Block (stage in git)
 
- Accept Change (apply this file)
 
- Reject Change (skip this file)
 
- Accept All (apply all changes)
 
- Reject All (cancel everything)
 
Step 4: Manage Prompts
Prompts Tab:
- View all prompt templates
 
- Create new prompts for your needs
 
- Edit existing ones
 
- Delete unused prompts
 
Your AI must return JSON in this format:
[
  {
    "type": "file",
    "path": "src/app.js",
    "lang": "javascript",
    "content": "console.log('new code');"
  }
]
Important: Each file should be on one line in the JSON array to keep files compact.
🎨 Built-in Prompt Templates
- default - General code improvements
 
- refactor - Clean code, SOLID principles
 
- feature - Add new functionality
 
- bugfix - Fix bugs with minimal changes
 
- documentation - Add comments and docs
 
- security - Security audit and fixes
 
⚙️ Settings
Ctrl+, → Search "AI Code Bridge":
agentDirectory: Where snapshots are saved (default: .agent) 
excludeFolders: Folders to skip (node_modules, .git, etc.) 
excludeFileExtensions: File types to skip (.zip, .mp4, etc.) 
💡 Quick Tips
Export:
- Select multiple files with 
Ctrl+Click 
- Export only relevant files, not entire project
 
- Snapshots include: prompt name, date, hour, and minute
 
Import:
- Always preview before accepting
 
- Changes are copied to clipboard automatically
 
- Test after importing
 
- Commit to git before importing large changes
 
Prompts:
- Create custom prompts for your project
 
- Include your coding standards
 
- Reuse across all projects
 
🔒 Safety
✅ Preview every change before applying
✅ Accept/reject individually
✅ Side-by-side diff view
✅ Stage changes in git directly
✅ No automatic changes
🐛 Troubleshooting
JSON Import Fails:
- Make sure AI returned only JSON array
 
- Check JSON syntax at jsonlint.com
 
- Remove any text before 
[ or after ] 
Sidebar Not Showing:
- Click the AI Code Bridge icon in activity bar (left side)
 
- Reload VSCode: 
Ctrl+Shift+P → "Reload Window" 
Stage Block Not Working:
- Ensure git extension is active
 
- Check if you're in a git repository
 
📊 System Requirements
- VSCode 1.80.0 or higher
 
- Works with any programming language
 
- Windows, macOS, Linux
 
🎓 Example Workflow
1. Right-click on src/ folder → Export to AI Snapshot
2. Content is copied to clipboard automatically  
3. Paste in Claude/ChatGPT
4. Ask: "Add error handling to all functions"
5. Copy AI's JSON response
6. Open AI Code Bridge sidebar → Import tab
7. Paste JSON → Click "Import from Text"
8. Preview each change
9. Click "Accept" or "Stage Block" for good changes
10. Click "Reject" for unwanted changes
11. Done!
📄 License
MIT License - Free for personal and commercial use
Made for developers who use AI assistants 💙
Version 2.10.7 | 2025