Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>AI Code BridgeNew to Visual Studio Code? Get it now.
AI Code Bridge

AI Code Bridge

Reza Ahmadi Sabzevar

|
3 installs
| (0) | Free
Bridge between VSCode and LLMs - Export code snapshots and import AI-generated changes with preview
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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

  1. Download the .vsix file
  2. In VSCode: Ctrl+Shift+P → "Extensions: Install from VSIX"
  3. 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:

  1. Paste the AI's JSON response
  2. Click "Import from Text"
  3. Preview each change side-by-side
  4. Click Accept ✓ or Reject ✗ for each file
  5. 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

📝 AI Response Format

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

  1. default - General code improvements
  2. refactor - Clean code, SOLID principles
  3. feature - Add new functionality
  4. bugfix - Fix bugs with minimal changes
  5. documentation - Add comments and docs
  6. 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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft