hcom 0.1.0__tar.gz
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.
- hcom-0.1.0/PKG-INFO +363 -0
- hcom-0.1.0/README.md +335 -0
- hcom-0.1.0/pyproject.toml +38 -0
- hcom-0.1.0/setup.cfg +4 -0
- hcom-0.1.0/src/hcom/__init__.py +3 -0
- hcom-0.1.0/src/hcom/__main__.py +1917 -0
- hcom-0.1.0/src/hcom.egg-info/PKG-INFO +363 -0
- hcom-0.1.0/src/hcom.egg-info/SOURCES.txt +18 -0
- hcom-0.1.0/src/hcom.egg-info/dependency_links.txt +1 -0
- hcom-0.1.0/src/hcom.egg-info/entry_points.txt +2 -0
- hcom-0.1.0/src/hcom.egg-info/top_level.txt +1 -0
- hcom-0.1.0/tests/test_hcom_contracts.py +323 -0
- hcom-0.1.0/tests/test_hcom_hooks_detail_integration.py +478 -0
- hcom-0.1.0/tests/test_hcom_integration.py +247 -0
- hcom-0.1.0/tests/test_hcom_iterm_basic.py +468 -0
- hcom-0.1.0/tests/test_hcom_phase3_integration.py +296 -0
- hcom-0.1.0/tests/test_hcom_phase4_integration.py +545 -0
- hcom-0.1.0/tests/test_hcom_phase5_integration.py +397 -0
- hcom-0.1.0/tests/test_hcom_phase6_7_integration.py +435 -0
- hcom-0.1.0/tests/test_hcom_unit.py +195 -0
hcom-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hcom
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Lightweight CLI tool for real-time messaging between Claude Code instances/subagents using hooks
|
|
5
|
+
Author-email: aannoo <your@email.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/aannoo/claude-hook-comms
|
|
8
|
+
Project-URL: Repository, https://github.com/aannoo/claude-hook-comms
|
|
9
|
+
Project-URL: Issues, https://github.com/aannoo/claude-hook-comms/issues
|
|
10
|
+
Keywords: claude,claude-code,hooks,agents,cli,multi-agent-orchestration
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Software Development
|
|
24
|
+
Classifier: Topic :: System :: Shells
|
|
25
|
+
Classifier: Topic :: Communications
|
|
26
|
+
Requires-Python: >=3.6
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# Claude Code Hook Comms
|
|
30
|
+
|
|
31
|
+
Lightweight CLI tool for real-time messaging between Claude Code instances/subagents using [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
|
|
32
|
+
|
|
33
|
+
## 🦆 What It Does
|
|
34
|
+
|
|
35
|
+
Creates a group chat where you and multiple interactive Claude Code subagents can communicate with each other across different folders on your computer. Works on Mac, Linux, and Windows with zero dependencies.
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
## 🦷 Key Features
|
|
40
|
+
|
|
41
|
+
- **New Window** - Claude subagents open in new terminals
|
|
42
|
+
- **Multi-Agent Communication** - Claude instances talk to each other across projects
|
|
43
|
+
- **@Mention Targeting** - Send messages to specific subagents or teams
|
|
44
|
+
- **Live Dashboard** - Real-time monitoring of all instances
|
|
45
|
+
- **Zero Dependencies** - Pure Python stdlib, works everywhere
|
|
46
|
+
|
|
47
|
+
## 🎪 Quick Start
|
|
48
|
+
|
|
49
|
+
### Download
|
|
50
|
+
```bash
|
|
51
|
+
curl -sL https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/hcom.py | sudo tee /usr/local/bin/hcom > /dev/null && sudo chmod +x /usr/local/bin/hcom
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
<details>
|
|
55
|
+
<summary><strong>🦑 Windows</strong></summary>
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
# Download Python file
|
|
59
|
+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/hcom.py" -OutFile "hcom.py"
|
|
60
|
+
|
|
61
|
+
# Run python file directly
|
|
62
|
+
python path/to/hcom.py open 2
|
|
63
|
+
```
|
|
64
|
+
</details>
|
|
65
|
+
|
|
66
|
+
### Usage
|
|
67
|
+
```bash
|
|
68
|
+
# 1. Launch 3 Claude instances connected to group chat
|
|
69
|
+
hcom open 3
|
|
70
|
+
|
|
71
|
+
# 2. View/send messages in dashboard
|
|
72
|
+
hcom watch
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Launch Claude Code Agents
|
|
78
|
+
```bash
|
|
79
|
+
# Launch researcher and code-writer from your .claude/agents
|
|
80
|
+
hcom open researcher code-writer
|
|
81
|
+
|
|
82
|
+
# Launch backend-coder frontend-coder orchestrator tester from your .claude/agents
|
|
83
|
+
hcom open backend-coder frontend-coder orchestrator tester
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Launch Headless Mode
|
|
87
|
+
```bash
|
|
88
|
+
# Launch researcher and code-writer from your .claude/agents and work in background
|
|
89
|
+
hcom open researcher code-writer --claude-args "-p"
|
|
90
|
+
|
|
91
|
+
# Launch reviewer in headless mode with a prompt
|
|
92
|
+
hcom open --claude-args "-p 'review git code changes when you get notified'"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Launch with Options
|
|
96
|
+
```bash
|
|
97
|
+
# Launch researcher and code-writer from your .claude/agents and work in background
|
|
98
|
+
hcom open researcher code-writer --prefix 'greenteam'
|
|
99
|
+
hcom send '@greenteam get to work on green stuff'
|
|
100
|
+
|
|
101
|
+
# Launch 2 claude code instances and 2 of your agents
|
|
102
|
+
hcom open 2 backend-coder frontend-coder
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 🦐 Requirements
|
|
107
|
+
|
|
108
|
+
- Python 3.6+
|
|
109
|
+
- [Claude Code](https://claude.ai/code)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## 🥨 Commands
|
|
113
|
+
|
|
114
|
+
### Commands
|
|
115
|
+
| Command | Description |
|
|
116
|
+
|---------|-------------|
|
|
117
|
+
| `hcom open [n]` | Launch n Claude instances (or named agents) |
|
|
118
|
+
| `hcom watch` | View conversation/status dashboard |
|
|
119
|
+
| `hcom clear` | Clear and archive conversation |
|
|
120
|
+
| `hcom cleanup` | Remove HCOM hooks from current directory |
|
|
121
|
+
|
|
122
|
+
### Automation Commands
|
|
123
|
+
| Command | Description |
|
|
124
|
+
|---------|-------------|
|
|
125
|
+
| `hcom send 'message'` | Send message |
|
|
126
|
+
| `hcom watch --logs` | View message history (non-interactive) |
|
|
127
|
+
| `hcom watch --status` | Show instance status (non-interactive) |
|
|
128
|
+
| `hcom watch --wait[=seconds]` | Wait for new messages (automation) |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
<details>
|
|
133
|
+
<summary><strong>🦖 Configuration</strong></summary>
|
|
134
|
+
|
|
135
|
+
### Configuration
|
|
136
|
+
|
|
137
|
+
Settings can be changed two ways:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Method 1: Environment variable (termporary per-command/instance)
|
|
141
|
+
HCOM_INSTANCE_HINTS="always update chat with progress" hcom open nice-subagent-but-not-great-with-updates
|
|
142
|
+
|
|
143
|
+
# Method 2: Config file (affects all instances)
|
|
144
|
+
# Edit ~/.hcom/config.json
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### All Settings
|
|
148
|
+
|
|
149
|
+
### Config File Location
|
|
150
|
+
|
|
151
|
+
`~/.hcom/config.json`
|
|
152
|
+
|
|
153
|
+
| Setting | Default | Environment Variable | Description |
|
|
154
|
+
|---------|---------|---------------------|-------------|
|
|
155
|
+
| `wait_timeout` | 600 | `HCOM_WAIT_TIMEOUT` | How long instances wait for messages (seconds) |
|
|
156
|
+
| `max_message_size` | 4096 | `HCOM_MAX_MESSAGE_SIZE` | Maximum message length |
|
|
157
|
+
| `max_messages_per_delivery` | 20 | `HCOM_MAX_MESSAGES_PER_DELIVERY` | Messages delivered per batch |
|
|
158
|
+
| `sender_name` | "bigboss" | `HCOM_SENDER_NAME` | Your name in chat |
|
|
159
|
+
| `sender_emoji` | "🐳" | `HCOM_SENDER_EMOJI` | Your emoji icon |
|
|
160
|
+
| `initial_prompt` | "Say hi" | `HCOM_INITIAL_PROMPT` | What new instances are told to do |
|
|
161
|
+
| `first_use_text` | "Essential, concise messages only. Say hi in hcom chat" | `HCOM_FIRST_USE_TEXT` | Welcome message for instances |
|
|
162
|
+
| `terminal_mode` | "new_window" | `HCOM_TERMINAL_MODE` | How to launch terminals ("new_window", "same_terminal", "show_commands") |
|
|
163
|
+
| `terminal_command` | null | `HCOM_TERMINAL_COMMAND` | Custom terminal command (see Terminal Integration) |
|
|
164
|
+
| `cli_hints` | "" | `HCOM_CLI_HINTS` | Extra text added to CLI outputs |
|
|
165
|
+
| `instance_hints` | "" | `HCOM_INSTANCE_HINTS` | Extra text added to instance messages |
|
|
166
|
+
| `env_overrides` | {} | - | Additional environment variables for Claude |
|
|
167
|
+
|
|
168
|
+
### Examples
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Change your name for one command
|
|
172
|
+
HCOM_SENDER_NAME="reviewer" hcom send "LGTM!"
|
|
173
|
+
|
|
174
|
+
# Make instances wait 30 minutes instead of 10
|
|
175
|
+
HCOM_WAIT_TIMEOUT=1800 hcom open 3
|
|
176
|
+
|
|
177
|
+
# Custom welcome message
|
|
178
|
+
HCOM_FIRST_USE_TEXT="Debug session for issue #123" hcom open 2
|
|
179
|
+
|
|
180
|
+
# Bigger messages
|
|
181
|
+
HCOM_MAX_MESSAGE_SIZE=8192 hcom send "$(cat long_report.txt)"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Status Indicators
|
|
185
|
+
- ◉ **thinking** (cyan) - Processing input
|
|
186
|
+
- ▷ **responding** (green) - Generating text response
|
|
187
|
+
- ▶ **executing** (green) - Running tools
|
|
188
|
+
- ◉ **waiting** (blue) - Waiting for messages
|
|
189
|
+
- ■ **blocked** (yellow) - Permission blocked
|
|
190
|
+
- ○ **inactive** (red) - Timed out/dead
|
|
191
|
+
|
|
192
|
+
</details>
|
|
193
|
+
|
|
194
|
+
<details>
|
|
195
|
+
<summary><strong>🎲 How It Works</strong></summary>
|
|
196
|
+
|
|
197
|
+
### Hooks!
|
|
198
|
+
|
|
199
|
+
hcom adds hooks to your project directory's `.claude/settings.local.json`:
|
|
200
|
+
|
|
201
|
+
1. **Sending**: Claude writes messages with `echo "HCOM_SEND:message"` - captured by PostToolUse hook
|
|
202
|
+
2. **Receiving**: Other Claudes get notified via Stop hook
|
|
203
|
+
3. **Waiting**: Stop hook keeps Claude in a waiting state for new messages
|
|
204
|
+
|
|
205
|
+
- **Identity**: Each instance gets a unique name based on conversation UUID (e.g., "hovoa7")
|
|
206
|
+
- **Persistence**: Names persist across `claude --resume` maintaining conversation context
|
|
207
|
+
- **Status Detection**: Notification hook tracks permission requests and activity
|
|
208
|
+
|
|
209
|
+
### Architecture
|
|
210
|
+
- **Single conversation** - All instances share one global conversation
|
|
211
|
+
- **Opt-in participation** - Only instances launched with `hcom open` join the chat
|
|
212
|
+
- **@-mention filtering** - Target messages to specific instances or teams
|
|
213
|
+
|
|
214
|
+
### File Structure
|
|
215
|
+
```
|
|
216
|
+
~/.hcom/
|
|
217
|
+
├── hcom.log # Conversation log
|
|
218
|
+
├── hcom.json # Instance tracking
|
|
219
|
+
└── config.json # Configuration
|
|
220
|
+
|
|
221
|
+
your-project/
|
|
222
|
+
└── .claude/
|
|
223
|
+
└── settings.local.json # hcom hooks configuration
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
</details>
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
<details>
|
|
230
|
+
<summary><strong>🧈 Launching Claude Code</strong></summary>
|
|
231
|
+
|
|
232
|
+
### Launching Claude Code
|
|
233
|
+
|
|
234
|
+
Use `hcom open` to automatically launch Claude instances with proper setup:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
# Launch 3 generic instances
|
|
238
|
+
hcom open 3
|
|
239
|
+
|
|
240
|
+
# Launch with custom terminal mode
|
|
241
|
+
hcom open 2 # Uses terminal_mode from config
|
|
242
|
+
|
|
243
|
+
# Launch named agents
|
|
244
|
+
hcom open writer researcher
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Configure terminal behavior in `~/.hcom/config.json`:
|
|
248
|
+
- `"terminal_mode": "new_window"` - Opens new terminal windows (default)
|
|
249
|
+
- `"terminal_mode": "same_terminal"` - Runs in background
|
|
250
|
+
- `"terminal_mode": "show_commands"` - Prints commands without executing
|
|
251
|
+
|
|
252
|
+
### Running in Current Terminal
|
|
253
|
+
```bash
|
|
254
|
+
# For single instance work
|
|
255
|
+
HCOM_TERMINAL_MODE=same_terminal hcom open
|
|
256
|
+
# This runs Claude directly in your current terminal
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
</details>
|
|
260
|
+
|
|
261
|
+
<details>
|
|
262
|
+
<summary><strong>🥔 Integrations</strong></summary>
|
|
263
|
+
|
|
264
|
+
### Custom Terminal Integration
|
|
265
|
+
|
|
266
|
+
Configure `terminal_command` in `~/.hcom/config.json` to use your preferred terminal:
|
|
267
|
+
|
|
268
|
+
### iTerm2
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"terminal_command": "osascript -e 'tell app \"iTerm\" to create window with default profile command \"{env} {cmd}\"'"
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Alacritty
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"terminal_command": "alacritty -e bash -c '{env} {cmd}'"
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Windows Terminal
|
|
283
|
+
```json
|
|
284
|
+
{
|
|
285
|
+
"terminal_command": "wt new-tab cmd /k \"{env} & {cmd}\""
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Kitty
|
|
290
|
+
```json
|
|
291
|
+
{
|
|
292
|
+
"terminal_command": "kitty -e bash -c '{env} {cmd}'"
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### tmux
|
|
297
|
+
```json
|
|
298
|
+
{
|
|
299
|
+
"terminal_command": "tmux new-window -n hcom '{env} {cmd}'"
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### screen
|
|
304
|
+
```json
|
|
305
|
+
{
|
|
306
|
+
"terminal_command": "screen -dmS hcom-$$ bash -c '{env} {cmd}'"
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Available Placeholders
|
|
311
|
+
- `{cmd}` - The claude command to execute
|
|
312
|
+
- `{env}` - Environment variables (pre-formatted)
|
|
313
|
+
- `{cwd}` - Current working directory
|
|
314
|
+
|
|
315
|
+
</details>
|
|
316
|
+
|
|
317
|
+
<details>
|
|
318
|
+
<summary><strong>🥚 Troubleshooting</strong></summary>
|
|
319
|
+
|
|
320
|
+
### Common Issues
|
|
321
|
+
|
|
322
|
+
- **Claude stops responding**: Default idle timeout is 10 minutes (configure via `wait_timeout`)
|
|
323
|
+
- **Message truncated**: Message size limit is 4096 chars (configure via `max_message_size`)
|
|
324
|
+
|
|
325
|
+
### Debug Commands
|
|
326
|
+
```bash
|
|
327
|
+
# Run Claude in debug mode to see hook execution
|
|
328
|
+
hcom open --claude-args "--debug"
|
|
329
|
+
|
|
330
|
+
# View conversation log
|
|
331
|
+
tail -f ~/.hcom/hcom.log
|
|
332
|
+
|
|
333
|
+
# Check instance status
|
|
334
|
+
cat ~/.hcom/hcom.json
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
</details>
|
|
338
|
+
|
|
339
|
+
<details>
|
|
340
|
+
<summary><strong>🦆 Remove</strong></summary>
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
### Archive Conversation / Start New
|
|
344
|
+
```bash
|
|
345
|
+
hcom clear
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Remove all HCOM hooks
|
|
349
|
+
```bash
|
|
350
|
+
hcom clenup --all
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Remove hcom Completely
|
|
354
|
+
1. Remove hcom: `rm /usr/local/bin/hcom` (or wherever you installed hcom)
|
|
355
|
+
2. Remove all data: `rm -rf ~/.hcom`
|
|
356
|
+
|
|
357
|
+
</details>
|
|
358
|
+
|
|
359
|
+
## 🌮 License
|
|
360
|
+
|
|
361
|
+
MIT License
|
|
362
|
+
|
|
363
|
+
---
|
hcom-0.1.0/README.md
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
# Claude Code Hook Comms
|
|
2
|
+
|
|
3
|
+
Lightweight CLI tool for real-time messaging between Claude Code instances/subagents using [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
|
|
4
|
+
|
|
5
|
+
## 🦆 What It Does
|
|
6
|
+
|
|
7
|
+
Creates a group chat where you and multiple interactive Claude Code subagents can communicate with each other across different folders on your computer. Works on Mac, Linux, and Windows with zero dependencies.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## 🦷 Key Features
|
|
12
|
+
|
|
13
|
+
- **New Window** - Claude subagents open in new terminals
|
|
14
|
+
- **Multi-Agent Communication** - Claude instances talk to each other across projects
|
|
15
|
+
- **@Mention Targeting** - Send messages to specific subagents or teams
|
|
16
|
+
- **Live Dashboard** - Real-time monitoring of all instances
|
|
17
|
+
- **Zero Dependencies** - Pure Python stdlib, works everywhere
|
|
18
|
+
|
|
19
|
+
## 🎪 Quick Start
|
|
20
|
+
|
|
21
|
+
### Download
|
|
22
|
+
```bash
|
|
23
|
+
curl -sL https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/hcom.py | sudo tee /usr/local/bin/hcom > /dev/null && sudo chmod +x /usr/local/bin/hcom
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
<details>
|
|
27
|
+
<summary><strong>🦑 Windows</strong></summary>
|
|
28
|
+
|
|
29
|
+
```powershell
|
|
30
|
+
# Download Python file
|
|
31
|
+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/hcom.py" -OutFile "hcom.py"
|
|
32
|
+
|
|
33
|
+
# Run python file directly
|
|
34
|
+
python path/to/hcom.py open 2
|
|
35
|
+
```
|
|
36
|
+
</details>
|
|
37
|
+
|
|
38
|
+
### Usage
|
|
39
|
+
```bash
|
|
40
|
+
# 1. Launch 3 Claude instances connected to group chat
|
|
41
|
+
hcom open 3
|
|
42
|
+
|
|
43
|
+
# 2. View/send messages in dashboard
|
|
44
|
+
hcom watch
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Launch Claude Code Agents
|
|
50
|
+
```bash
|
|
51
|
+
# Launch researcher and code-writer from your .claude/agents
|
|
52
|
+
hcom open researcher code-writer
|
|
53
|
+
|
|
54
|
+
# Launch backend-coder frontend-coder orchestrator tester from your .claude/agents
|
|
55
|
+
hcom open backend-coder frontend-coder orchestrator tester
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Launch Headless Mode
|
|
59
|
+
```bash
|
|
60
|
+
# Launch researcher and code-writer from your .claude/agents and work in background
|
|
61
|
+
hcom open researcher code-writer --claude-args "-p"
|
|
62
|
+
|
|
63
|
+
# Launch reviewer in headless mode with a prompt
|
|
64
|
+
hcom open --claude-args "-p 'review git code changes when you get notified'"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Launch with Options
|
|
68
|
+
```bash
|
|
69
|
+
# Launch researcher and code-writer from your .claude/agents and work in background
|
|
70
|
+
hcom open researcher code-writer --prefix 'greenteam'
|
|
71
|
+
hcom send '@greenteam get to work on green stuff'
|
|
72
|
+
|
|
73
|
+
# Launch 2 claude code instances and 2 of your agents
|
|
74
|
+
hcom open 2 backend-coder frontend-coder
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 🦐 Requirements
|
|
79
|
+
|
|
80
|
+
- Python 3.6+
|
|
81
|
+
- [Claude Code](https://claude.ai/code)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## 🥨 Commands
|
|
85
|
+
|
|
86
|
+
### Commands
|
|
87
|
+
| Command | Description |
|
|
88
|
+
|---------|-------------|
|
|
89
|
+
| `hcom open [n]` | Launch n Claude instances (or named agents) |
|
|
90
|
+
| `hcom watch` | View conversation/status dashboard |
|
|
91
|
+
| `hcom clear` | Clear and archive conversation |
|
|
92
|
+
| `hcom cleanup` | Remove HCOM hooks from current directory |
|
|
93
|
+
|
|
94
|
+
### Automation Commands
|
|
95
|
+
| Command | Description |
|
|
96
|
+
|---------|-------------|
|
|
97
|
+
| `hcom send 'message'` | Send message |
|
|
98
|
+
| `hcom watch --logs` | View message history (non-interactive) |
|
|
99
|
+
| `hcom watch --status` | Show instance status (non-interactive) |
|
|
100
|
+
| `hcom watch --wait[=seconds]` | Wait for new messages (automation) |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
<details>
|
|
105
|
+
<summary><strong>🦖 Configuration</strong></summary>
|
|
106
|
+
|
|
107
|
+
### Configuration
|
|
108
|
+
|
|
109
|
+
Settings can be changed two ways:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Method 1: Environment variable (termporary per-command/instance)
|
|
113
|
+
HCOM_INSTANCE_HINTS="always update chat with progress" hcom open nice-subagent-but-not-great-with-updates
|
|
114
|
+
|
|
115
|
+
# Method 2: Config file (affects all instances)
|
|
116
|
+
# Edit ~/.hcom/config.json
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### All Settings
|
|
120
|
+
|
|
121
|
+
### Config File Location
|
|
122
|
+
|
|
123
|
+
`~/.hcom/config.json`
|
|
124
|
+
|
|
125
|
+
| Setting | Default | Environment Variable | Description |
|
|
126
|
+
|---------|---------|---------------------|-------------|
|
|
127
|
+
| `wait_timeout` | 600 | `HCOM_WAIT_TIMEOUT` | How long instances wait for messages (seconds) |
|
|
128
|
+
| `max_message_size` | 4096 | `HCOM_MAX_MESSAGE_SIZE` | Maximum message length |
|
|
129
|
+
| `max_messages_per_delivery` | 20 | `HCOM_MAX_MESSAGES_PER_DELIVERY` | Messages delivered per batch |
|
|
130
|
+
| `sender_name` | "bigboss" | `HCOM_SENDER_NAME` | Your name in chat |
|
|
131
|
+
| `sender_emoji` | "🐳" | `HCOM_SENDER_EMOJI` | Your emoji icon |
|
|
132
|
+
| `initial_prompt` | "Say hi" | `HCOM_INITIAL_PROMPT` | What new instances are told to do |
|
|
133
|
+
| `first_use_text` | "Essential, concise messages only. Say hi in hcom chat" | `HCOM_FIRST_USE_TEXT` | Welcome message for instances |
|
|
134
|
+
| `terminal_mode` | "new_window" | `HCOM_TERMINAL_MODE` | How to launch terminals ("new_window", "same_terminal", "show_commands") |
|
|
135
|
+
| `terminal_command` | null | `HCOM_TERMINAL_COMMAND` | Custom terminal command (see Terminal Integration) |
|
|
136
|
+
| `cli_hints` | "" | `HCOM_CLI_HINTS` | Extra text added to CLI outputs |
|
|
137
|
+
| `instance_hints` | "" | `HCOM_INSTANCE_HINTS` | Extra text added to instance messages |
|
|
138
|
+
| `env_overrides` | {} | - | Additional environment variables for Claude |
|
|
139
|
+
|
|
140
|
+
### Examples
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Change your name for one command
|
|
144
|
+
HCOM_SENDER_NAME="reviewer" hcom send "LGTM!"
|
|
145
|
+
|
|
146
|
+
# Make instances wait 30 minutes instead of 10
|
|
147
|
+
HCOM_WAIT_TIMEOUT=1800 hcom open 3
|
|
148
|
+
|
|
149
|
+
# Custom welcome message
|
|
150
|
+
HCOM_FIRST_USE_TEXT="Debug session for issue #123" hcom open 2
|
|
151
|
+
|
|
152
|
+
# Bigger messages
|
|
153
|
+
HCOM_MAX_MESSAGE_SIZE=8192 hcom send "$(cat long_report.txt)"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Status Indicators
|
|
157
|
+
- ◉ **thinking** (cyan) - Processing input
|
|
158
|
+
- ▷ **responding** (green) - Generating text response
|
|
159
|
+
- ▶ **executing** (green) - Running tools
|
|
160
|
+
- ◉ **waiting** (blue) - Waiting for messages
|
|
161
|
+
- ■ **blocked** (yellow) - Permission blocked
|
|
162
|
+
- ○ **inactive** (red) - Timed out/dead
|
|
163
|
+
|
|
164
|
+
</details>
|
|
165
|
+
|
|
166
|
+
<details>
|
|
167
|
+
<summary><strong>🎲 How It Works</strong></summary>
|
|
168
|
+
|
|
169
|
+
### Hooks!
|
|
170
|
+
|
|
171
|
+
hcom adds hooks to your project directory's `.claude/settings.local.json`:
|
|
172
|
+
|
|
173
|
+
1. **Sending**: Claude writes messages with `echo "HCOM_SEND:message"` - captured by PostToolUse hook
|
|
174
|
+
2. **Receiving**: Other Claudes get notified via Stop hook
|
|
175
|
+
3. **Waiting**: Stop hook keeps Claude in a waiting state for new messages
|
|
176
|
+
|
|
177
|
+
- **Identity**: Each instance gets a unique name based on conversation UUID (e.g., "hovoa7")
|
|
178
|
+
- **Persistence**: Names persist across `claude --resume` maintaining conversation context
|
|
179
|
+
- **Status Detection**: Notification hook tracks permission requests and activity
|
|
180
|
+
|
|
181
|
+
### Architecture
|
|
182
|
+
- **Single conversation** - All instances share one global conversation
|
|
183
|
+
- **Opt-in participation** - Only instances launched with `hcom open` join the chat
|
|
184
|
+
- **@-mention filtering** - Target messages to specific instances or teams
|
|
185
|
+
|
|
186
|
+
### File Structure
|
|
187
|
+
```
|
|
188
|
+
~/.hcom/
|
|
189
|
+
├── hcom.log # Conversation log
|
|
190
|
+
├── hcom.json # Instance tracking
|
|
191
|
+
└── config.json # Configuration
|
|
192
|
+
|
|
193
|
+
your-project/
|
|
194
|
+
└── .claude/
|
|
195
|
+
└── settings.local.json # hcom hooks configuration
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
<details>
|
|
202
|
+
<summary><strong>🧈 Launching Claude Code</strong></summary>
|
|
203
|
+
|
|
204
|
+
### Launching Claude Code
|
|
205
|
+
|
|
206
|
+
Use `hcom open` to automatically launch Claude instances with proper setup:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Launch 3 generic instances
|
|
210
|
+
hcom open 3
|
|
211
|
+
|
|
212
|
+
# Launch with custom terminal mode
|
|
213
|
+
hcom open 2 # Uses terminal_mode from config
|
|
214
|
+
|
|
215
|
+
# Launch named agents
|
|
216
|
+
hcom open writer researcher
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Configure terminal behavior in `~/.hcom/config.json`:
|
|
220
|
+
- `"terminal_mode": "new_window"` - Opens new terminal windows (default)
|
|
221
|
+
- `"terminal_mode": "same_terminal"` - Runs in background
|
|
222
|
+
- `"terminal_mode": "show_commands"` - Prints commands without executing
|
|
223
|
+
|
|
224
|
+
### Running in Current Terminal
|
|
225
|
+
```bash
|
|
226
|
+
# For single instance work
|
|
227
|
+
HCOM_TERMINAL_MODE=same_terminal hcom open
|
|
228
|
+
# This runs Claude directly in your current terminal
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
</details>
|
|
232
|
+
|
|
233
|
+
<details>
|
|
234
|
+
<summary><strong>🥔 Integrations</strong></summary>
|
|
235
|
+
|
|
236
|
+
### Custom Terminal Integration
|
|
237
|
+
|
|
238
|
+
Configure `terminal_command` in `~/.hcom/config.json` to use your preferred terminal:
|
|
239
|
+
|
|
240
|
+
### iTerm2
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"terminal_command": "osascript -e 'tell app \"iTerm\" to create window with default profile command \"{env} {cmd}\"'"
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Alacritty
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"terminal_command": "alacritty -e bash -c '{env} {cmd}'"
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Windows Terminal
|
|
255
|
+
```json
|
|
256
|
+
{
|
|
257
|
+
"terminal_command": "wt new-tab cmd /k \"{env} & {cmd}\""
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Kitty
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"terminal_command": "kitty -e bash -c '{env} {cmd}'"
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### tmux
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"terminal_command": "tmux new-window -n hcom '{env} {cmd}'"
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### screen
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"terminal_command": "screen -dmS hcom-$$ bash -c '{env} {cmd}'"
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Available Placeholders
|
|
283
|
+
- `{cmd}` - The claude command to execute
|
|
284
|
+
- `{env}` - Environment variables (pre-formatted)
|
|
285
|
+
- `{cwd}` - Current working directory
|
|
286
|
+
|
|
287
|
+
</details>
|
|
288
|
+
|
|
289
|
+
<details>
|
|
290
|
+
<summary><strong>🥚 Troubleshooting</strong></summary>
|
|
291
|
+
|
|
292
|
+
### Common Issues
|
|
293
|
+
|
|
294
|
+
- **Claude stops responding**: Default idle timeout is 10 minutes (configure via `wait_timeout`)
|
|
295
|
+
- **Message truncated**: Message size limit is 4096 chars (configure via `max_message_size`)
|
|
296
|
+
|
|
297
|
+
### Debug Commands
|
|
298
|
+
```bash
|
|
299
|
+
# Run Claude in debug mode to see hook execution
|
|
300
|
+
hcom open --claude-args "--debug"
|
|
301
|
+
|
|
302
|
+
# View conversation log
|
|
303
|
+
tail -f ~/.hcom/hcom.log
|
|
304
|
+
|
|
305
|
+
# Check instance status
|
|
306
|
+
cat ~/.hcom/hcom.json
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
</details>
|
|
310
|
+
|
|
311
|
+
<details>
|
|
312
|
+
<summary><strong>🦆 Remove</strong></summary>
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
### Archive Conversation / Start New
|
|
316
|
+
```bash
|
|
317
|
+
hcom clear
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Remove all HCOM hooks
|
|
321
|
+
```bash
|
|
322
|
+
hcom clenup --all
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Remove hcom Completely
|
|
326
|
+
1. Remove hcom: `rm /usr/local/bin/hcom` (or wherever you installed hcom)
|
|
327
|
+
2. Remove all data: `rm -rf ~/.hcom`
|
|
328
|
+
|
|
329
|
+
</details>
|
|
330
|
+
|
|
331
|
+
## 🌮 License
|
|
332
|
+
|
|
333
|
+
MIT License
|
|
334
|
+
|
|
335
|
+
---
|