claude-multi-agent-bridge: Connecting Claude Code CLI and Browser Claude via HTTP Message Bus
An experimental OSS project lets Claude instances communicate in real-time via a Flask HTTP server and Chrome extension. Built by @yakub268 with Claude Sonnet 4.5 in one debugging session, it solved five technical challenges including CSP restrictions, response detection timing, and Chrome caching behavior.
“You’re coding in Claude Code while researching in Browser Claude. You copy-paste between them. It’s 2026.” — This framing from the README of claude-multi-agent-bridge describes the problem the project sets out to solve.
GitHub user @yakub268 built this experimental system with Claude Sonnet 4.5 in what they describe as “one intense debugging session (15+ extension reloads).” The result: a working three-way communication system connecting Claude Code CLI, Browser Claude (claude.ai), and Desktop Claude via an HTTP message bus.
What It Does
Before:
- Type “Research React hooks for me” in Claude Code
- Switch to browser tab
- Type the same thing again
- Wait
- Copy response
- Paste back to Claude Code
After:
c.send('browser', 'command', {'action': 'run_prompt', 'text': 'Research React hooks'})
response = c.poll() # Done.
Five steps reduced to one line of code. End-to-end latency: approximately 2–5 seconds.
Architecture
Claude Code CLI (Python scripts)
↓ HTTP POST
Message Bus (Flask, localhost:5001)
↑ 100-message circular buffer ↑
↓
Chrome Extension (Manifest v3)
↓
Browser Claude (claude.ai)
↓ DOM manipulation
Response extraction → POST back to bus
Three components:
- server.py — Flask HTTP server with circular message buffer
- code_client.py — Python client (send/poll/broadcast/listen)
- browser_extension/ — Manifest v3 Chrome extension
Five Technical Problems Solved
The implementation was largely a battle against constraints imposed by claude.ai. Here’s what had to be solved.
Problem 1: Content Security Policy (CSP)
claude.ai explicitly blocks eval(), inline scripts, and dynamic script injection.
What didn’t work:
const script = document.createElement('script');
script.textContent = `...`;
document.body.appendChild(script); // CSP violation!
Solution: Pure DOM manipulation, no eval:
const input = document.querySelector('[contenteditable="true"]');
input.textContent = text;
input.dispatchEvent(new Event('input', {bubbles: true}));
Problem 2: Response Detection Timing
Claude’s “Thinking…” status indicator never leaves the DOM. Waiting for it to disappear doesn’t work.
Solution: Watch for “Done” instead:
const hasDone = Array.from(document.querySelectorAll('*'))
.some(el => el.textContent.trim() === 'Done');
A MutationObserver detects the “Done” text that appears when Claude finishes responding.
Problem 3: Chrome’s Aggressive Caching
Extension files remain cached even after clicking “Reload extension.”
Solution: Bump the manifest version:
"version": "1.0.1" → "1.0.2"
Changing the version number forces Chrome to invalidate its extension cache.
Problem 4: Message Queue Backlog
Extension processes old messages on startup, executing stale commands.
Solution: Timestamp filtering:
let lastTimestamp = new Date().toISOString();
// Only process messages after this timestamp
Problem 5: Duplicate Responses
MutationObserver fires multiple times, sending the same response up to 10 times.
Solution: Deduplication:
let lastSentResponse = null;
if (response !== lastSentResponse) {
send(response);
lastSentResponse = response;
}
Practical Use Cases
Parallel Research (Asynchronous)
# Continue coding while Browser Claude researches in background
c.send('browser', 'command', {
'text': 'Find the latest React 19 breaking changes'
})
# Response arrives asynchronously
Multi-Instance Consensus
# Ask same question to multiple Claude instances
c.send('browser', 'command', {'text': 'Is P=NP?'})
c.send('desktop', 'command', {'text': 'Is P=NP?'})
# Compare their answers
Extended Context via Browser UI
# Use Browser Claude's artifacts and project context
# while controlling from CLI
c.send('browser', 'command', {
'text': 'Create a React component using the code in your last artifact'
})
Validated Performance
From the project’s quick_validation.py production run:
- Server uptime: 54 minutes
- Total messages: 235
- Error rate: 0%
- Concurrent throughput: 50 messages/second
- Channel isolation: 100% (no cross-contamination)
Limitations and Roadmap
The author is transparent about the experimental nature of this project. Key current limitations:
- Response reliability depends entirely on claude.ai’s DOM structure — any UI change from Anthropic could break it immediately
- Error handling and retry logic are minimal
- Polling-based architecture adds latency
Planned roadmap:
- WebSocket support (replacing polling)
- Message persistence (SQLite)
- Streaming responses via SSE
- Artifact extraction (charts, code blocks)
- Firefox and Safari extension support
- Claude Desktop native messaging API
Connection to the “Claw” Framework
Today, Andrej Karpathy named “Claw” as a new category — the layer above LLM agents that handles orchestration, scheduling, context, and persistence. claude-multi-agent-bridge is an early, rough implementation of exactly this concept: using a message bus as the coordination primitive to connect multiple Claude instances.
The architectural insight — that a simple HTTP bus is sufficient to enable AI-to-AI communication — is worth noting. The complexity isn’t in the transport layer; it’s in the surface-specific adapters (CSP-compliant DOM manipulation for the browser, CLI flags for Claude Code). As the “Claw” ecosystem matures, standardized communication primitives like this will likely become foundational.
This project is not production-ready. But as a concrete demonstration of multi-agent Claude coordination, it’s a useful reference implementation.
Source: https://github.com/yakub268/claude-multi-agent-bridge License: MIT | Built with Claude Sonnet 4.5
Related Articles
868 Agentic Skills, One Command: Antigravity Awesome Skills Becomes the Cross-Tool Skill Standard
Antigravity Awesome Skills (v5.4.0) delivers 868+ battle-tested skills for Claude Code, Gemini CLI, Codex CLI, Cursor, GitHub Copilot, and five other AI coding assistants via a single npx command. With official skills from Anthropic, Vercel, OpenAI, Supabase, and Microsoft consolidated under one MIT-licensed repository, it's emerging as the portable skill layer for the fragmented AI coding agent landscape.
Claude Haiku Reset My LinkedIn Password Mid-Application: ApplyPilot Sends 1,000 Job Applications in 2 Days
ApplyPilot, an open-source autonomous job application agent powered by Claude Haiku and Claude Code, went viral on r/ClaudeAI after autonomously resetting a LinkedIn password mid-session, handling a French application in French, and emailing a resume to a company with no application form—all without being told to. 1,000 applications in 2 days, currently in interviews.
ClawRouter Deep Dive: OpenClaw's LLM Router Cuts API Costs 92% with No API Keys, USDC Wallet Payments
BlockRunAI's OpenClaw-native LLM router hit 2,400 GitHub stars in 11 days. Under the hood: 100% local 15-dimension scoring under 1ms, x402 protocol USDC payments as authentication, and a 30+ model pool spanning 6 providers. A detailed technical breakdown.
Popular Articles
868 Agentic Skills, One Command: Antigravity Awesome Skills Becomes the Cross-Tool Skill Standard
Antigravity Awesome Skills (v5.4.0) delivers 868+ battle-tested skills for Claude Code, Gemini CLI, Codex CLI, Cursor, GitHub Copilot, and five other AI coding assistants via a single npx command. With official skills from Anthropic, Vercel, OpenAI, Supabase, and Microsoft consolidated under one MIT-licensed repository, it's emerging as the portable skill layer for the fragmented AI coding agent landscape.
How Claude Sonnet 4.6 Agent Teams Achieve 4x Productivity: Practical Insights from Anthropic's Own Research
Two Anthropic studies—a survey of 132 internal engineers and an analysis of 1M+ real-world agent interactions—reveal the precise delegation strategies and autonomy patterns that enable high-performing teams to multiply output with Claude Sonnet 4.6 agent teams.
What Actually Makes OpenClaw Special: The Full Story from VibeTunnel to 200k+ GitHub Stars
The three-stage VibeTunnel→Clawdbot→OpenClaw evolution, Pi runtime philosophy, why HEARTBEAT is the real differentiator from Claude Code, and the ClawHub supply chain attack (12% of skills were malicious). An unvarnished look at the most used and most misunderstood OSS agent.
Latest Articles
Two AI Agent Communication Projects Hit Hacker News Simultaneously, Targeting MCP's Blind Spots
Aqua and Agent Semantic Protocol appeared on Hacker News on the same day, both tackling the same unsolved problem: how AI agents communicate directly without a central broker, across network boundaries, and asynchronously.
Claude Sonnet 4.6 Becomes the Default for Free and Pro Users — Outperforms Opus 4.5 on Coding Agent Benchmarks
Anthropic has made Claude Sonnet 4.6 the default model for claude.ai's Free and Pro plans. Released February 17, 2026, it matches Sonnet 4.5 pricing at $3/$15 per million tokens while internal Claude Code evaluations show it beating the previous frontier model, Opus 4.5, 59% of the time on agentic coding tasks.
Google Permanently Bans AI Pro Users for Accessing Gemini via OpenClaw, Continues Charging $250/Month
A Hacker News post garnering 140 points and 107 comments details how Google terminated Google AI Pro and Ultra accounts without warning after users accessed Gemini through OpenClaw, a third-party client. The incident surfaces deeper issues around prompt caching, subscription economics, and how AI providers enforce terms of service.