When working in web AI chats, manually feeding context is tedious. You need to pick relevant files, strip sensitive keys, format markdown, and stay under the model context window.
We built the TokenCap Companion (Manifest V3 Chrome Extension) to automate this workflow securely.
How It Operates Under Manifest V3
- Sandboxed Local Query: When you open the extension popup, it queries
http://127.0.0.1:4545/generatewith your local pairing token. - Model-Aware Budgeting: You pick your active target model (GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Pro). The extension requests a payload formatted specifically for that context window.
- Content Script Injection: Using content scripts (
content/chatgpt.js,content/claude.js,content/gemini.js), the companion locates the active chat prompt DOM element and populates it.
[TokenCap Companion Popup]
Project: my-saas-api
Task: "Add rate limiting to /api/auth routes"
Model: Claude 3.5 Sonnet
Token Count: 8,450 / 200,000 (Safe)
[ Inject Into Chat ]
The extension requests only minimal permissions (storage, activeTab, clipboardWrite), and source code is never transmitted outside localhost.
Download and install instructions at tokencap.vansharora.app
Top comments (0)