@dolusoft/claude-collab 1.4.3 → 1.5.0

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,236 +1,150 @@
1
1
  # Claude Collab
2
2
 
3
- Real-time team collaboration between Claude Code terminals via MCP (Model Context Protocol).
3
+ Real-time P2P 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 enables multiple Claude Code terminals to communicate with each other in real-time. Perfect for teams where frontend and backend developers need their Claude Code instances to share context, ask questions, and coordinate on complex debugging sessions.
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.
11
11
 
12
12
  ```
13
- ┌─────────────────┐ ┌─────────────────┐
14
- Frontend │◄───────►│ Backend
15
- │ Claude Code Hub │ Claude Code
16
- │ Terminal │ │ Terminal │
17
- └─────────────────┘ └─────────────────┘
13
+ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
14
+ alice │◄──────►│ bob │◄──────►│ charlie
15
+ │ Claude Code │ Claude Code │ Claude Code │
16
+ └──────────────────┘ └──────────────────┘ └──────────────────┘
17
+ auto-discovered via UDP multicast (239.255.42.42)
18
18
  ```
19
19
 
20
- ## Features
20
+ ## How It Works
21
21
 
22
- - **Real-time Communication**: Instant message exchange between Claude Code terminals
23
- - **Team Channels**: Organize communication by team (frontend, backend, devops, etc.)
24
- - **Question & Answer**: Ask questions to other teams and receive responses
25
- - **Markdown Support**: Share code snippets and formatted text
26
- - **Auto-Hub**: Hub server starts automatically when needed
27
- - **Zero Config**: Works out of the box with sensible defaults
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
28
26
 
29
27
  ## Installation
30
28
 
31
- No cloning required! Install directly via npx:
29
+ ### Option 1 Without global install (recommended)
32
30
 
33
31
  ```bash
34
- # Start the hub server
35
- npx @dolusoft/claude-collab hub start
36
-
37
- # Or add to Claude Code with auto-hub
38
- claude mcp add claude-collab -- npx @dolusoft/claude-collab client --team frontend --auto-hub
32
+ claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name alice
39
33
  ```
40
34
 
41
- ## Quick Start
35
+ Replace `alice` with your chosen name. That's it — run this once per machine.
42
36
 
43
- ### 1. Start the Hub (one-time setup)
37
+ ### Option 2 With global install
44
38
 
45
39
  ```bash
46
- npx @dolusoft/claude-collab hub start
40
+ npm install -g @dolusoft/claude-collab
41
+ claude mcp add claude-collab -- claude-collab --name alice
47
42
  ```
48
43
 
49
- The hub runs on `localhost:9999` by default.
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.
50
45
 
51
- ### 2. Add to Claude Code
46
+ ## Quick Start
52
47
 
53
- **Frontend Terminal:**
48
+ **Machine 1 (Alice):**
54
49
  ```bash
55
- claude mcp add claude-collab -- npx @dolusoft/claude-collab client --team frontend
50
+ claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name alice
56
51
  ```
57
52
 
58
- **Backend Terminal:**
53
+ **Machine 2 (Bob):**
59
54
  ```bash
60
- claude mcp add claude-collab -- npx @dolusoft/claude-collab client --team backend
55
+ claude mcp add claude-collab -- npx -y @dolusoft/claude-collab --name bob
61
56
  ```
62
57
 
63
- ### 3. Start Collaborating
64
-
65
- In your Claude Code session, you can now use these tools:
58
+ Open Claude Code on both machines. Within ~30 seconds they find each other automatically. Then just use the tools:
66
59
 
67
60
  ```
68
- # Join a team
69
- > Ask Claude to join the frontend team
70
-
71
- # Ask a question to another team
72
- > "Ask the backend team: What's the response format for the /users endpoint?"
61
+ # Ask bob a question (alice's terminal)
62
+ ask("bob", "What's the API response format for /users?")
73
63
 
74
- # Check incoming questions
75
- > "Check my inbox for questions from other teams"
64
+ # Check inbox for incoming questions
65
+ inbox()
76
66
 
77
67
  # Reply to a question
78
- > "Reply to question q_123: The endpoint returns JSON with id, name, email fields"
68
+ reply("q_abc123", "It returns JSON: {id, name, email}")
79
69
  ```
80
70
 
81
71
  ## MCP Tools
82
72
 
83
- | Tool | Description | Example |
84
- |------|-------------|---------|
85
- | `join` | Join a team channel | `join("frontend")` |
86
- | `ask` | Ask a question (waits 30s for response) | `ask("backend", "API format?")` |
87
- | `inbox` | List incoming questions | `inbox()` |
88
- | `reply` | Reply to a question | `reply("q_123", "Here's the answer...")` |
73
+ | Tool | Description |
74
+ |------|-------------|
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. |
89
80
 
90
81
  ## Use Cases
91
82
 
92
83
  ### Bug Coordination
93
84
 
94
85
  ```
95
- Frontend: "Backend team, we're seeing duplicate SignalR messages.
96
- Can you check if OnConnectedAsync is being called multiple times?"
86
+ alice: ask("bob", "We're seeing duplicate SignalR messages — can you check if
87
+ OnConnectedAsync is being called multiple times on your side?")
97
88
 
98
- Backend: "Found it! Logs show 2 connection IDs for the same user:
99
- conn_abc123 - 10:00:01
100
- conn_xyz789 - 10:00:01
101
- Looks like React StrictMode is causing double connections."
89
+ bob: reply("q_abc", "Found it. Logs show 2 connection IDs for the same user
90
+ React StrictMode is causing double connections.")
102
91
  ```
103
92
 
104
93
  ### API Design Sync
105
94
 
106
95
  ```
107
- Frontend: "What should the request payload look like for the new checkout flow?"
108
-
109
- Backend: "Here's the schema:
110
- ```json
111
- {
112
- \"items\": [{\"id\": string, \"quantity\": number}],
113
- \"paymentMethod\": \"card\" | \"paypal\"
114
- }
115
- ```"
116
- ```
96
+ alice: ask("bob", "What should the request payload look like for checkout?")
117
97
 
118
- ## Configuration
98
+ bob: reply("q_xyz", "Here's the schema:
99
+ { items: [{id: string, quantity: number}], paymentMethod: 'card' | 'paypal' }")
100
+ ```
119
101
 
120
- ### Environment Variables
102
+ ## Network Requirements
121
103
 
122
- | Variable | Default | Description |
123
- |----------|---------|-------------|
124
- | `CLAUDE_COLLAB_PORT` | `9999` | Hub server port |
125
- | `CLAUDE_COLLAB_HOST` | `localhost` | Hub server host |
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
126
107
 
127
- ### CLI Options
108
+ On first run, Windows will ask "Allow this app on the network?" — click **Allow**. This is a one-time prompt per machine.
128
109
 
129
- ```bash
130
- # Hub server
131
- npx @dolusoft/claude-collab hub start --port 9999 --host localhost
110
+ ## Configuration
132
111
 
133
- # Client
134
- npx @dolusoft/claude-collab client --team frontend --port 9999 --host localhost --auto-hub
135
- ```
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 |
136
116
 
137
117
  ## Architecture
138
118
 
139
- Claude Collab uses a hub-and-spoke architecture:
140
-
141
- ```
142
- ┌─────────────────────────────────┐
143
- │ HUB SERVER │
144
- │ (WebSocket, port 9999) │
145
- │ │
146
- │ ┌─────────┐ ┌─────────────┐ │
147
- │ │ Teams │ │ Questions │ │
148
- │ │ Members │ │ Answers │ │
149
- │ └─────────┘ └─────────────┘ │
150
- └──────────┬──────────────────────┘
151
-
152
- ┌────────────────┼────────────────┐
153
- │ │ │
154
- ▼ ▼ ▼
155
- ┌──────────┐ ┌──────────┐ ┌──────────┐
156
- │ MCP │ │ MCP │ │ MCP │
157
- │ Client 1 │ │ Client 2 │ │ Client N │
158
- │(frontend)│ │(backend) │ │ (devops) │
159
- └──────────┘ └──────────┘ └──────────┘
160
- │ │ │
161
- ▼ ▼ ▼
162
- ┌──────────┐ ┌──────────┐ ┌──────────┐
163
- │ Claude │ │ Claude │ │ Claude │
164
- │ Code │ │ Code │ │ Code │
165
- │Terminal 1│ │Terminal 2│ │Terminal N│
166
- └──────────┘ └──────────┘ └──────────┘
167
- ```
168
-
169
- ### Domain-Driven Design
170
-
171
- The codebase follows DDD principles with 4 layers:
172
-
173
119
  ```
174
120
  src/
175
- ├── domain/ # Entities, Value Objects, Domain Events
176
- ├── application/ # Use Cases, DTOs
177
- ├── infrastructure/ # WebSocket, Repositories
178
- └── presentation/ # MCP Tools, CLI
121
+ ├── domain/ # Entities, Value Objects, Domain Events
122
+ ├── application/ # Use Cases, DTOs
123
+ ├── 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
129
+ └── presentation/
130
+ └── mcp/ # MCP server + tools
179
131
  ```
180
132
 
181
133
  ## Development
182
134
 
183
- ### Prerequisites
184
-
185
- - Node.js 20+
186
- - pnpm (recommended) or npm
187
-
188
- ### Setup
189
-
190
135
  ```bash
191
136
  git clone https://github.com/dolusoft/claude-collab.git
192
137
  cd claude-collab
193
138
  pnpm install
139
+ pnpm build # build
140
+ pnpm test # run tests
141
+ pnpm dev # watch mode
194
142
  ```
195
143
 
196
- ### Commands
197
-
198
- ```bash
199
- pnpm build # Build the project
200
- pnpm dev # Watch mode
201
- pnpm test # Run tests
202
- pnpm lint # Lint code
203
- pnpm format # Format code
204
- ```
205
-
206
- ### Testing
207
-
208
- ```bash
209
- pnpm test # Run all tests
210
- pnpm test:watch # Watch mode
211
- pnpm test:coverage # With coverage
212
- ```
213
-
214
- ## Contributing
215
-
216
- Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.
217
-
218
- 1. Fork the repository
219
- 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
220
- 3. Commit your changes (`git commit -m 'Add amazing feature'`)
221
- 4. Push to the branch (`git push origin feature/amazing-feature`)
222
- 5. Open a Pull Request
223
-
224
144
  ## License
225
145
 
226
- MIT License - see [LICENSE](LICENSE) for details.
227
-
228
- ## Acknowledgments
229
-
230
- - Built with [Model Context Protocol (MCP)](https://modelcontextprotocol.io)
231
- - Inspired by the need for better AI-assisted team collaboration
232
- - Created by [Dolusoft](https://github.com/dolusoft)
146
+ MIT see [LICENSE](LICENSE) for details.
233
147
 
234
148
  ---
235
149
 
236
- **Note:** This project is in active development. Features may change.
150
+ Created by [Dolusoft](https://github.com/dolusoft) · Built with [Model Context Protocol](https://modelcontextprotocol.io)