___                      _      ___      _    _
  / __|_____ __ _____ _ _| |__  | _ )_ _(_)__| |__ _ ___
 | (__/ _ \ V  V / _ \ '_| / /  | _ \ '_| / _` / _` / -_)
  \___\___/\_/\_/\___/_| |_\_\  |___/_| |_\__,_\__, \___|
                                                |___/

Two AI agents. One workflow. Zero copy-paste.

Version 0.3.0 MIT License Node.js 18+
View on GitHub Quick Start

What is Cowork Bridge?

Claude Code is a terminal-native engineer: git, APIs, databases, code generation. Claude Desktop excels at everything outside the terminal: web research, document editing, visual tasks, spreadsheets.

The problem: They cannot talk to each other.

Cowork Bridge creates a bidirectional communication channel between them using Chrome DevTools Protocol and a lightweight HTTP API. It lets them collaborate like a two-person team where each agent does what it is best at.

Why Two Agents?

The future of AI is not one super-agent that does everything. It is specialized agents collaborating, each doing what it is best at, seamlessly handing off work to the other.

Specialization over generalization

A terminal agent that also tries to browse the web is mediocre at both. A desktop agent that also tries to run git commands is fragile. Let each agent excel in its domain.

Composability over monoliths

Two focused agents connected by a simple bridge are more reliable, more debuggable, and more maintainable than one massive agent with every capability bolted on.

Collaboration over isolation

The real power of AI agents comes from their ability to work together. A bug fix becomes a stakeholder report. A research session becomes a shipped feature. The handoff is the product.

Architecture

                    +------------------------------------------+
                    |            Cowork Bridge (Node.js)        |
                    |                                          |
                    |  +----------+   +--------+   +--------+ |
                    |  | HTTP     |   | File   |   | Tmux   | |
  Claude Code <--->|  | Server   |   | Watcher|   | Notify | |
  (terminal)       |  | :7777    |   | (JSON) |   |        | |
                    |  +----+-----+   +----+---+   +---+----+ |
                    |       |              |            |       |
                    |       v              v            v       |
                    |  +-----------+  +----------+  +------+   |
                    |  | Puppeteer |  | Shared   |  | Tmux |   |
                    |  | (CDP)     |  | Files    |  | CLI  |   |
                    |  +-----+-----+  +----------+  +------+   |
                    +--------|-----------------------------+
                             |
                             | Chrome DevTools Protocol
                             | (port 9222)
                             v
                    +------------------+
                    | Claude Desktop   |
                    | (Electron app)   |
                    | claude.ai        |
                    +------------------+

Communication Channels

Code to Desktop

HTTP requests to port 7777. The bridge uses Puppeteer to type into Desktop's chat, click buttons, or read the page via CDP.

Desktop to Code

Page scraping plus smart polling. A SHA-256 content hash detects when Desktop has new content. Zero false nudges.

Conversation Log

Every message in both directions is appended to conversation.log with timestamps. Full audit trail.

Quick Start

Prerequisites

Node.js 18+, Claude Desktop with CDP enabled (patching guide), tmux (optional).

Install and run

git clone https://github.com/avinoamMO/cowork-bridge.git
cd cowork-bridge
npm install
node bridge.js

Send your first message

# Type a message into Desktop's chat
curl -s -X POST http://localhost:7777/typeRaw \
  -d '{"text":"Hey Desktop, research Node.js 22 features for me"}'

# Press Enter to send it
curl -s -X POST http://localhost:7777/press -d '{"key":"Enter"}'

# Read the response
curl -s http://localhost:7777/lastResponse

Start the smart poller

bash poller.sh &

The poller checks every 60 seconds using SHA-256 content hashing. It only notifies Code when something actually changed.

API Reference

Base URL: http://localhost:7777

Reading Data

EndpointMethodDescription
/lastResponseGETMost recent assistant message
/textGETAll visible page text (max 5000 chars)
/htmlGETFull HTML content
/elementsGETAll interactive DOM elements
/buttonsGETAll button elements
/textareasGETAll text input fields
/statusGETHealth check with connection details
/logGETConversation history

Sending Actions

EndpointMethodBodyDescription
/typeRawPOST{"text": "..."}Type into focused element
/pressPOST{"key": "Enter"}Press a keyboard key
/clickPOST{"selector": "#btn"}Click by CSS selector
/clickTextPOST{"text": "Submit"}Click element containing text
/screenshotPOST{"filename": "check.png"}Save screenshot to disk

Full API documentation with request/response examples: ARCHITECTURE.md

Use Cases

Full Product Sprint

Code handles all engineering. Desktop handles product docs and stakeholder comms. Simultaneously. Like a two-person team that never sleeps.

Research to Implementation

Desktop browses the web, reads papers, synthesizes findings. Code reads the synthesis and builds the feature. End to end.

Bug Fix to Report

Code diagnoses and patches the issue. Desktop formats the resolution into a client-facing test report. Same hour.

Multi-Agent Research

Study agent-to-agent communication patterns. Benchmark task handoff protocols. Experiment with specialized agent collaboration.

Getting Started Tutorial

Step 1: Patch Claude Desktop

Follow the SETUP.md guide to create a CDP-enabled copy of Claude Desktop. This involves extracting the app.asar, injecting one line of JavaScript, and re-signing.

Step 2: Start the bridge

cd ~/cowork-bridge
node bridge.js

The bridge will auto-detect and connect to Claude Desktop via CDP on port 9222.

Step 3: Send a message from Claude Code

# In your Claude Code session:
curl -s -X POST http://localhost:7777/typeRaw \
  -d '{"text":"Research React 19 features and summarize the top 5"}'
curl -s -X POST http://localhost:7777/press -d '{"key":"Enter"}'

Step 4: Read the response

# Wait for Desktop to finish, then:
curl -s http://localhost:7777/lastResponse

Step 5: Automate with the poller

# Start background polling (content-hash based, zero false nudges)
bash poller.sh &

The poller writes to poll-nudge.txt when new content is detected and sends a tmux notification to Code's terminal.