___ _ ___ _ _
/ __|_____ __ _____ _ _| |__ | _ )_ _(_)__| |__ _ ___
| (__/ _ \ V V / _ \ '_| / / | _ \ '_| / _` / _` / -_)
\___\___/\_/\_/\___/_| |_\_\ |___/_| |_\__,_\__, \___|
|___/
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.
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.
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.
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.
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.
+------------------------------------------+
| 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 |
+------------------+
HTTP requests to port 7777. The bridge uses Puppeteer to type into Desktop's chat, click buttons, or read the page via CDP.
Page scraping plus smart polling. A SHA-256 content hash detects when Desktop has new content. Zero false nudges.
Every message in both directions is appended to conversation.log with timestamps. Full audit trail.
Node.js 18+, Claude Desktop with CDP enabled (patching guide), tmux (optional).
git clone https://github.com/avinoamMO/cowork-bridge.git
cd cowork-bridge
npm install
node bridge.js
# 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
bash poller.sh &
The poller checks every 60 seconds using SHA-256 content hashing. It only notifies Code when something actually changed.
Base URL: http://localhost:7777
| Endpoint | Method | Description |
|---|---|---|
/lastResponse | GET | Most recent assistant message |
/text | GET | All visible page text (max 5000 chars) |
/html | GET | Full HTML content |
/elements | GET | All interactive DOM elements |
/buttons | GET | All button elements |
/textareas | GET | All text input fields |
/status | GET | Health check with connection details |
/log | GET | Conversation history |
| Endpoint | Method | Body | Description |
|---|---|---|---|
/typeRaw | POST | {"text": "..."} | Type into focused element |
/press | POST | {"key": "Enter"} | Press a keyboard key |
/click | POST | {"selector": "#btn"} | Click by CSS selector |
/clickText | POST | {"text": "Submit"} | Click element containing text |
/screenshot | POST | {"filename": "check.png"} | Save screenshot to disk |
Full API documentation with request/response examples: ARCHITECTURE.md
Code handles all engineering. Desktop handles product docs and stakeholder comms. Simultaneously. Like a two-person team that never sleeps.
Desktop browses the web, reads papers, synthesizes findings. Code reads the synthesis and builds the feature. End to end.
Code diagnoses and patches the issue. Desktop formats the resolution into a client-facing test report. Same hour.
Study agent-to-agent communication patterns. Benchmark task handoff protocols. Experiment with specialized agent collaboration.
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.
cd ~/cowork-bridge
node bridge.js
The bridge will auto-detect and connect to Claude Desktop via CDP on port 9222.
# 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"}'
# Wait for Desktop to finish, then:
curl -s http://localhost:7777/lastResponse
# 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.