tool

claude-multi-agent-bridge: Connecting Claude Code CLI and Browser Claude via HTTP Message Bus

AI Tools Hub
#Claude Code #multi-agent #Python #Chrome extension #OSS #AI agents #HTTP

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:

  1. Type “Research React hooks for me” in Claude Code
  2. Switch to browser tab
  3. Type the same thing again
  4. Wait
  5. Copy response
  6. 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

関連記事

tool

Claude CodeとブラウザClaudeを直接つなぐ——「claude-multi-agent-bridge」が解決した5つの技術的難問

Claudeインスタンス同士をリアルタイム通信させるOSS「claude-multi-agent-bridge」が公開された。Claude Code CLI、ブラウザClaude、デスクトップClaudeをHTTPメッセージバスで接続する実験的な実装で、CSP制約・レスポンス検出・Chromeキャッシュなど5つの技術的難問をどう解決したかを詳細に解説する。

続きを読む →
tool

868のスキルをnpx 1コマンドで——「Antigravity Awesome Skills」が主要AIコーディングエージェントの共通スキル基盤になりつつある

Claude Code・Gemini CLI・Codex CLI・Cursor・GitHub Copilotなど主要AIコーディングアシスタントを横断する868以上のスキルライブラリ「Antigravity Awesome Skills」(v5.4.0)を詳細分析。Anthropic・Vercel・OpenAI・Supabase・Microsoftの公式スキルを統合した設計思想、ロール別バンドル・ワークフロー機能、SKILL.mdによる相互運用性のアーキテクチャを解説する。

続きを読む →
tool

Claude HaikuがLinkedInのパスワードを勝手にリセット――自律型就職応募エージェント「ApplyPilot」が2日間で1,000件を突破

オープンソースの自律型就職応募エージェント「ApplyPilot」がr/ClaudeAIで話題に。Claude HaikuがLinkedInセッション切れを検知してパスワードリセットを自己判断、フランス語の求人には全工程をフランス語で対応。2日間1,000件応募・面接中という結果が採用市場にAIスパムという新たな問題を提起している。

続きを読む →

人気記事

Comparison

ChatGPT(OpenAI)とClaude(Anthropic)の機能比較 2026年版。コーディング・長文解析・コスト・API料金の違いを検証

ChatGPT(GPT-4o/o3)とClaude(Sonnet 4.6/Opus 4.5)を2026年時点の最新情報で比較する。コーディング能力、長文処理、日本語品質、API料金、無料プランの違いをSWE-benchなどのベンチマーク結果とともに解説する。

続きを読む →
opinion

【2026年2月20日 所感】「AIがコードを書く」は仮説から現実になった——しかし私たちはその意味をまだ消化できていない

2026年2月20日に観測したコーディングエージェント関連ニュースの総括と所感。Anthropicの自律性研究、cmux、MJ Rathbunのエージェント事故、HN「外骨格 vs チーム」論争、Stripe Minions週1000件PR、Taalas 17k tokens/sec——朝から夜までの流れを通じて見えてきた「AIがコードを書く時代」の実相を考察する。

続きを読む →
tool

868のスキルをnpx 1コマンドで——「Antigravity Awesome Skills」が主要AIコーディングエージェントの共通スキル基盤になりつつある

Claude Code・Gemini CLI・Codex CLI・Cursor・GitHub Copilotなど主要AIコーディングアシスタントを横断する868以上のスキルライブラリ「Antigravity Awesome Skills」(v5.4.0)を詳細分析。Anthropic・Vercel・OpenAI・Supabase・Microsoftの公式スキルを統合した設計思想、ロール別バンドル・ワークフロー機能、SKILL.mdによる相互運用性のアーキテクチャを解説する。

続きを読む →

最新記事

0 tools selected