WebAiBridge


WebAiBridge

A VS Code extension + Chrome extension that lets you send code context from your editor directly to AI chat sites (ChatGPT, Claude, Gemini, etc.).

GitHub Repository


What It Does


Architecture

┌─────────────┐     WebSocket      ┌─────────────────┐
│   VS Code   │◄──────────────────►│ Chrome Extension│
│  Extension  │    localhost:64923 │  (content.js)   │
└─────────────┘                    └────────┬────────┘
       │                                    │
       │ Reads files, selections,           │ Injects into
       │ problems, git diff, etc.           │ AI chat input
       │                                    │
       ▼                                    ▼
┌─────────────┐                    ┌─────────────────┐
│  Your Code  │                    │   AI Chat Site  │
│  Workspace  │                    │ (ChatGPT, etc.) │
└─────────────┘                    └─────────────────┘

The VS Code extension runs a local WebSocket server. The Chrome extension connects to it and injects content scripts into supported AI chat sites.


Supported Sites


Installation

VS Code Extension

# From VSIX file
code --install-extension webaibridge-vscode-0.4.0.vsix

# Or build from source
cd vscode-extension
npm install
npm run package

Chrome Extension

  1. Go to chrome://extensions
  2. Enable "Developer mode"
  3. Click "Load unpacked"
  4. Select the web-extension folder

Usage

Right-Click Menu

@ Mentions

Type @ in any supported AI chat input:

Trigger Description
@focused-file Currently open file
@selection Selected text
@visible-editors All visible editors
@open-tabs All open files
@problems Errors/warnings
@file-tree Workspace structure
@git-diff Uncommitted changes
@terminal Terminal output

Per-Message Limits

Set a token limit in the popup. Choose what happens when exceeded:

Multi-Instance

If you have multiple VS Code windows open, use the instance picker in the popup to switch between them.


Token Counting

Uses a BPE-style approximation calibrated against GPT-4/Claude tokenizers. ~95% accuracy for English text and code.

Supported models:


Roadmap


License

BSD-2-Clause

© 2025-2026 TechIdiots LLC