@anirudh242/contextbridge
v0.1.2
Published
Persistent, versioned AI project context for every coding tool you use.
Maintainers
Readme
ContextBridge
Git-style version control for your AI session context. Works across every coding tool you use.
The Problem
Working with AI assistants involves constantly running into context limits or losing the thread when switching between tools. Every time you start a new conversation, you have to painstakingly rebuild the project's current state and goals.
The Solution
ContextBridge captures your exact working state (git diffs, active tasks, blockers) and compresses it into an LLM-generated summary. You can then instantly inject that context into any agent or browser-based AI tool.
cb init # set up once per project
cb capture # after any AI session — auto-reads your git diff
cb inject # before starting a new session — injects context everywhereInstallation
Prerequisite: Node.js >= 18
npm install -g @anirudh242/contextbridge
# or run without installing:
npx @anirudh242/contextbridge initCore Commands
cb capture- Analyzes yourgit diffand summarizes the current session context. Add-m "note"to manually steer the summary, or--pasteto include clipboard content.cb inject- Injects the latest trusted context into your AI tools.cb log- View the version history of your project's captured sessions.cb status- Show the current ContextBridge status and configuration for this project.
Provider Setup
ContextBridge works best with an LLM for summarisation. cb init will walk you through the initial setup.
| Provider | Model used | Note |
| ----------- | --------------------------- | --------------------------------------------------- |
| anthropic | claude-haiku-4-5-20251001 | Recommended. Fast and highly accurate. |
| openai | gpt-4o-mini | Good alternative. |
| gemini | gemini-2.0-flash | Google's high-speed option. |
| ollama | qwen2.5-coder:7b | Free and completely private. Requires local Ollama. |
You can change your active provider at any time by running cb provider.
If you are using Ollama, you can configure the timeout limit by running cb timeout <ms>.
Tool-Specific Injection
What happens when you run cb inject:
- Antigravity:
AGENTS.mdis written automatically to your project root. Antigravity reads it on every agent task. Nothing else needed. - Codex:
cb inject --codex | codex exec -pipes context directly into a new session. - Browser tools (Claude, ChatGPT, Gemini): Context is copied to your clipboard automatically. Paste it at the start of your conversation.
Privacy & Storage
All context and configuration are stored locally in ~/.contextbridge/ on your machine. When using a cloud provider, only the LLM summary request is sent — not your raw git diff or clipboard content. When using Ollama, no data leaves your machine.
