@dolusoft/claude-collab 1.5.1 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,133 +1,88 @@
1
1
  # Claude Collab
2
2
 
3
- Real-time P2P collaboration between Claude Code terminals via MCP (Model Context Protocol).
3
+ Real-time collaboration between Claude Code terminals via MCP (Model Context Protocol).
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/@dolusoft%2Fclaude-collab.svg)](https://www.npmjs.com/package/@dolusoft/claude-collab)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
8
  ## Overview
9
9
 
10
- Claude Collab lets multiple Claude Code terminals communicate with each other in real-time over a local network. Terminals **automatically discover each other** via UDP multicast — no IP addresses, no port numbers, no hub server required.
10
+ Claude Collab lets multiple Claude Code terminals communicate with each other in real-time. One machine runs a lightweight hub server; everyone else connects to it — no firewall rules needed for clients.
11
11
 
12
12
  ```
13
- ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
14
- │ alice │◄──────►│ bob │◄──────►│ charlie
15
- Claude Code │ Claude Code │ │ Claude Code │
16
- └──────────────────┘ └──────────────────┘ └──────────────────┘
17
- auto-discovered via UDP multicast (239.255.42.42)
13
+ alice ──outbound──→ ┌─────────────────┐ ←──outbound── bob
14
+ charlie─outbound──→ hub server │ ←──outbound── dave
15
+ 192.168.1.5:9999
16
+ └─────────────────┘
18
17
  ```
19
18
 
20
- ## How It Works
19
+ ## Setup
21
20
 
22
- - Each terminal joins a shared **multicast group** on the LAN (like a meeting table)
23
- - When a terminal comes online it announces itself; others discover it automatically
24
- - Direct WebSocket connections are established between peers — no central server
25
- - When a terminal goes offline, peers detect it and remove it from the list
21
+ ### Step 1 Start the hub (one machine, one time)
26
22
 
27
- ## Installation
28
-
29
- ### Option 1 — Without global install (recommended)
23
+ Pick any machine on your network. Run in a terminal:
30
24
 
31
25
  ```bash
32
- claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name alice
26
+ npx @dolusoft/claude-collab --hub --port 9999
33
27
  ```
34
28
 
35
- Replace `alice` with your chosen name. That's it run this once per machine.
29
+ Keep this terminal open. The hub routes messages between everyone.
36
30
 
37
- ### Option 2 — With global install
31
+ ### Step 2 — Add to Claude Code (each machine, one time)
38
32
 
39
33
  ```bash
40
- npm install -g @dolusoft/claude-collab
41
- claude mcp add claude-collab -- claude-collab --name alice
34
+ claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name alice --server 192.168.1.5:9999
42
35
  ```
43
36
 
44
- > **Your name is saved permanently** in Claude Code's MCP config. Every time Claude Code opens, it starts as `alice` automatically you never need to set it again.
37
+ Replace `alice` with your name and `192.168.1.5:9999` with the hub machine's IP and port.
45
38
 
46
- ## Quick Start
39
+ > Your name and server address are saved permanently in Claude Code's MCP config. Every time Claude Code opens, it connects automatically — you never need to reconfigure.
47
40
 
48
- **Machine 1 (Alice):**
49
- ```bash
50
- claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name alice
51
- ```
41
+ ### With global install
52
42
 
53
- **Machine 2 (Bob):**
54
43
  ```bash
55
- claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name bob
56
- ```
57
-
58
- Open Claude Code on both machines. Within ~30 seconds they find each other automatically. Then just use the tools:
59
-
60
- ```
61
- # Ask bob a question (alice's terminal)
62
- ask("bob", "What's the API response format for /users?")
44
+ npm install -g @dolusoft/claude-collab
63
45
 
64
- # Check inbox for incoming questions
65
- inbox()
46
+ # Hub:
47
+ claude-collab --hub --port 9999
66
48
 
67
- # Reply to a question
68
- reply("q_abc123", "It returns JSON: {id, name, email}")
49
+ # Client (add to Claude Code):
50
+ claude mcp add claude-collab -- claude-collab --name alice --server 192.168.1.5:9999
69
51
  ```
70
52
 
71
53
  ## MCP Tools
72
54
 
73
55
  | Tool | Description |
74
56
  |------|-------------|
75
- | `ask` | Ask a peer a question. Waits up to 5 minutes for a response. |
76
- | `inbox` | List questions waiting for your reply. |
77
- | `reply` | Reply to a question by its ID. |
78
- | `check_answer` | Manually check if an answer arrived for a question ID. |
79
- | `get_info` | Show your name, port, local IPs, and connected peers. |
80
-
81
- ## Use Cases
57
+ | `ask` | Ask another peer a question. Waits up to 5 minutes for a response. |
58
+ | `reply` | Reply to an incoming question (called automatically by Claude). |
59
+ | `peers` | Show currently connected peers. |
60
+ | `history` | Show past questions and answers from this session. |
82
61
 
83
- ### Bug Coordination
62
+ ## Example
84
63
 
85
64
  ```
86
- alice: ask("bob", "We're seeing duplicate SignalR messages — can you check if
87
- OnConnectedAsync is being called multiple times on your side?")
65
+ # Alice asks Bob
66
+ ask("bob", "What's the response format for the /users endpoint?")
88
67
 
89
- bob: reply("q_abc", "Found it. Logs show 2 connection IDs for the same user —
90
- React StrictMode is causing double connections.")
91
- ```
92
-
93
- ### API Design Sync
68
+ # Bob sees the question automatically and replies
69
+ reply("q_abc123", "Returns JSON: { id, name, email }")
94
70
 
71
+ # Alice sees the answer
95
72
  ```
96
- alice: ask("bob", "What should the request payload look like for checkout?")
97
-
98
- bob: reply("q_xyz", "Here's the schema:
99
- { items: [{id: string, quantity: number}], paymentMethod: 'card' | 'paypal' }")
100
- ```
101
-
102
- ## Network Requirements
103
-
104
- - All machines must be on the **same local network** (LAN, office Wi-Fi, home network, or VPN)
105
- - UDP multicast port `11776` must be reachable within the subnet (not blocked between peers)
106
- - WebSocket port (auto-selected in range `11700–11750`) needs to be accessible on the local network
107
-
108
- On first run, Windows will ask "Allow this app on the network?" — click **Allow**. This is a one-time prompt per machine.
109
-
110
- ## Configuration
111
-
112
- | Env variable | Default | Description |
113
- |---|---|---|
114
- | `CLAUDE_COLLAB_PORT_MIN` | `11700` | WS port range start |
115
- | `CLAUDE_COLLAB_PORT_MAX` | `11750` | WS port range end |
116
73
 
117
74
  ## Architecture
118
75
 
119
76
  ```
120
77
  src/
121
- ├── domain/ # Entities, Value Objects, Domain Events
122
- ├── application/ # Use Cases, DTOs
123
78
  ├── infrastructure/
124
- │ ├── p2p/
125
- │ │ ├── multicast-discovery.ts # UDP multicast peer discovery
126
- │ │ ├── p2p-node.ts # WebSocket P2P node + ICollabClient
127
- │ │ └── p2p-message-protocol.ts # Wire protocol types
128
- │ └── terminal-injector/ # Injects questions into Claude Code terminal
79
+ │ ├── hub/
80
+ │ │ ├── hub-server.ts # WebSocket hub routes messages by name
81
+ │ │ ├── hub-client.ts # Connects to hub, implements ICollabClient
82
+ │ │ └── hub-protocol.ts # Wire protocol types
83
+ │ └── terminal-injector/ # Injects incoming questions into Claude Code
129
84
  └── presentation/
130
- └── mcp/ # MCP server + tools
85
+ └── mcp/ # MCP server + tools
131
86
  ```
132
87
 
133
88
  ## Development
@@ -136,9 +91,8 @@ src/
136
91
  git clone https://github.com/dolusoft/claude-collab.git
137
92
  cd claude-collab
138
93
  pnpm install
139
- pnpm build # build
140
- pnpm test # run tests
141
- pnpm dev # watch mode
94
+ pnpm build
95
+ pnpm test
142
96
  ```
143
97
 
144
98
  ## License