hcom 0.2.0__py3-none-any.whl → 0.2.2__py3-none-any.whl

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.

Potentially problematic release.


This version of hcom might be problematic. Click here for more details.

@@ -0,0 +1,449 @@
1
+ Metadata-Version: 2.4
2
+ Name: hcom
3
+ Version: 0.2.2
4
+ Summary: CLI tool for launching multiple Claude Code terminals with interactive subagents, headless persistence, and real-time communication via hooks
5
+ Author: aannoo
6
+ License-Expression: 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
+ Project-URL: Documentation, https://github.com/aannoo/claude-hook-comms#readme
11
+ Keywords: claude,claude-code,hooks,agents,cli,multi-agent,orchestration,terminal
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Topic :: Communications :: Chat
22
+ Classifier: Topic :: Software Development
23
+ Classifier: Topic :: System :: Monitoring
24
+ Classifier: Topic :: Terminals
25
+ Requires-Python: >=3.7
26
+ Description-Content-Type: text/markdown
27
+
28
+ # hcom - Claude Hook Comms
29
+
30
+ [![PyPI - Version](https://img.shields.io/pypi/v/hcom)](https://pypi.org/project/hcom/)
31
+ [![PyPI - License](https://img.shields.io/pypi/l/hcom)](https://opensource.org/license/MIT) [![Python Version](https://img.shields.io/badge/python-3.7+-blue.svg)](https://python.org) [![DeepWiki](https://img.shields.io/badge/DeepWiki-aannoo%2Fclaude--hook--comms-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANS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P7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/aannoo/claude-hook-comms)
32
+
33
+ CLI tool for launching multiple Claude Code terminals with interactive [subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents), headless persistence, and real-time communication via [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks). Works on Mac, Linux, Windows, and Android with zero dependencies.
34
+
35
+ ![Claude Code Hook Comms Example](https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/screencapture.gif)
36
+
37
+ ## 🥦 Usage
38
+
39
+ **Run without installing** ([uv](https://docs.astral.sh/uv/#installation))
40
+ ```bash
41
+ uvx hcom open 2
42
+ ```
43
+
44
+ **Install** (optional)
45
+ ```bash
46
+ pip install hcom
47
+ hcom open 2
48
+ ```
49
+
50
+ | Commands | |
51
+ |---------|-------------|
52
+ | `hcom open [n]` | Launch `n` instances or named agents |
53
+ | `hcom watch` | View live dashboard and messaging |
54
+ | `hcom clear` | Clear and start new conversation |
55
+ | `hcom cleanup` | Safely remove hcom hooks, preserving your project settings |
56
+
57
+
58
+ ## 🦆 What It Does
59
+
60
+ `hcom open` adds hooks to the `.claude/settings.local.json` file in the current folder and launches terminals with claude code that remain active, waiting to respond to messages in the shared chat. Normal Claude Code opened with `claude` remains unaffected by hcom.
61
+
62
+ ### Subagents in their own terminal
63
+ ```bash
64
+ # Launch subagents from your .claude/agents
65
+ hcom open planner code-writer reviewer
66
+ ```
67
+
68
+ ### Persistent headless instances
69
+ ```bash
70
+ # Launch one headless instance (default 30min timeout)
71
+ hcom open -p
72
+ ```
73
+
74
+ ### Groups and direct messages
75
+ ```bash
76
+ hcom open --prefix cool # Creates cool-hovoa7
77
+ hcom open --prefix cool # Creates cool-homab8
78
+ hcom send '@cool hi, you are cool'
79
+ hcom send '@homab8 hi, you are cooler'
80
+ ```
81
+
82
+ ### Persistent thinking mode
83
+ ```bash
84
+ # Thinking mode maintains for entire session
85
+ HCOM_INITIAL_PROMPT="ultrathink and do x" hcom open
86
+ # Every new message reply uses ultrathink
87
+ ```
88
+
89
+ ---
90
+
91
+
92
+ <details>
93
+ <summary><strong>🦷 Features</strong></summary>
94
+
95
+ - **Multi-Terminal Launch** - Launch Claude Code subagents in new terminals
96
+ - **Background Mode** - Run headless instances without terminal windows
97
+ - **Interactive subagents** - Run subagents in their own terminal window
98
+ - **Live Dashboard** - Real-time monitoring and messaging
99
+ - **Multi-Agent Communication** - Instances talk to each other via shared chat
100
+ - **@Mention Targeting** - Send messages to specific instances or teams
101
+ - **Session Persistence** - Resume previous conversations automatically
102
+ - **Zero Dependencies** - Pure Python stdlib, works everywhere
103
+ - **Cross-platform** - Native support for Windows, WSL, macOS, Linux, Android
104
+
105
+ </details>
106
+
107
+ <details>
108
+ <summary><strong>🥨 All Commands</strong></summary>
109
+
110
+
111
+ | Command | Description |
112
+ |---------|-------------|
113
+ | `hcom open [n]` | Launch n Claude instances (or named agents) |
114
+ | `hcom open -p` | Launch headless process |
115
+ | `hcom open --prefix <p> [n]` | Launch with `<p>` prefix (e.g., api-hova7) |
116
+ | `hcom open --claude-args "..."` | Pass flags to Claude Code |
117
+ | `hcom watch` | Conversation/status dashboard |
118
+ | `hcom clear` | Clear and archive conversation |
119
+ | `hcom cleanup` | Safely Remove HCOM hooks from current directory while preserving your settings (`--all` for all directories) |
120
+ | `hcom kill [name]` | Kill specific instance (--all for all running instances) |
121
+
122
+ ### Automation Commands
123
+ | Command | Description |
124
+ |---------|-------------|
125
+ | `hcom send 'message'` | Send message to all instances |
126
+ | `hcom send '@alias msg'` | Send to specific instances alias or prefix |
127
+ | `hcom watch --logs` | View message log history (non-interactive) |
128
+ | `hcom watch --status` | Show instance status as JSON (non-interactive) |
129
+ | `hcom watch --wait [timeout]` | Wait and notify for new messages |
130
+
131
+ </details>
132
+
133
+
134
+
135
+ <details>
136
+ <summary><strong>🗿 Examples</strong></summary>
137
+
138
+ ```bash
139
+ # Instances can be privately @mentioned by alias or prefix
140
+ hcom open --prefix cool # Creates cool-hovoa7
141
+ hcom open --prefix cool # Creates cool-hovob8
142
+ hcom open --prefix notcool # creates notcool-hovoc9
143
+
144
+ # Send a targeted message in dashboard
145
+ @notcool i think you smell good
146
+ @cool that other guy is smelly
147
+ @hovoa7 im lying about the smelly thing
148
+
149
+ # Launch 3 headless instances that die after 60 seconds of inactivity
150
+ HCOM_WAIT_TIMEOUT="60" hcom open 3 -p
151
+ # Manually kill all instances
152
+ hcom kill --all
153
+
154
+ # Launch multiple of the same subagent
155
+ hcom open reviewer reviewer reviewer
156
+
157
+ # Launch agent with specific prompt
158
+ HCOM_INITIAL_PROMPT='write tests' hcom open test-writer
159
+
160
+ # Resume instance (hcom chat will continue)
161
+ hcom open --claude-args "--resume session_id"
162
+
163
+ # Text appended to all messages recieved by instance
164
+ HCOM_INSTANCE_HINTS="remember where you came from" hcom open
165
+
166
+ # Pass multiple Claude flags
167
+ hcom open orchestrator --claude-args "--model sonnet --resume session_id"
168
+ ```
169
+
170
+ </details>
171
+
172
+ <details>
173
+ <summary><strong>🦖 Configuration</strong></summary>
174
+
175
+ ### Configuration
176
+
177
+ Settings can be changed two ways:
178
+
179
+ #### Method 1: Environment variable (temporary, per-command/instance)
180
+
181
+
182
+ ```bash
183
+ HCOM_INSTANCE_HINTS="always update chat with progress" hcom open nice-subagent-but-not-great-with-updates
184
+ ```
185
+
186
+ #### Method 2: Config file (persistent, affects all instances)
187
+
188
+ ### Config File Location
189
+
190
+ `~/.hcom/config.json`
191
+
192
+ | Setting | Default | Environment Variable | Description |
193
+ |---------|---------|---------------------|-------------|
194
+ | `wait_timeout` | 1800 | `HCOM_WAIT_TIMEOUT` | How long instances wait for messages (seconds) |
195
+ | `max_message_size` | 1048576 | `HCOM_MAX_MESSAGE_SIZE` | Maximum message length (1MB) |
196
+ | `max_messages_per_delivery` | 50 | `HCOM_MAX_MESSAGES_PER_DELIVERY` | Messages delivered per batch |
197
+ | `sender_name` | "bigboss" | `HCOM_SENDER_NAME` | Your name in chat |
198
+ | `sender_emoji` | "🐳" | `HCOM_SENDER_EMOJI` | Your emoji icon |
199
+ | `initial_prompt` | "Say hi in chat" | `HCOM_INITIAL_PROMPT` | What new instances are told to do |
200
+ | `first_use_text` | "Essential, concise messages only" | `HCOM_FIRST_USE_TEXT` | Welcome message for instances |
201
+ | `terminal_mode` | "new_window" | `HCOM_TERMINAL_MODE` | How to launch terminals ("new_window", "same_terminal", "show_commands") |
202
+ | `terminal_command` | null | `HCOM_TERMINAL_COMMAND` | Custom terminal command (see Terminal Options) |
203
+ | `cli_hints` | "" | `HCOM_CLI_HINTS` | Extra text added to CLI outputs |
204
+ | `instance_hints` | "" | `HCOM_INSTANCE_HINTS` | Extra text added to instance messages |
205
+ | `auto_watch` | true | `HCOM_AUTO_WATCH` | Auto-launch watch dashboard after open |
206
+ | `env_overrides` | {} | - | Additional environment variables for Claude Code |
207
+
208
+ ### Examples
209
+
210
+ ```bash
211
+ # Change your name for one command
212
+ HCOM_SENDER_NAME="coolguy" hcom send "LGTM!"
213
+
214
+ # Make instances timeout after 60 seconds instead of 30 minutes
215
+ HCOM_WAIT_TIMEOUT=60 hcom open 3
216
+
217
+ # Custom welcome message
218
+ HCOM_FIRST_USE_TEXT="Debug session for issue #123" hcom open 2
219
+
220
+ # Bigger delivery batches
221
+ HCOM_MAX_MESSAGES_PER_DELIVERY=100 hcom watch --logs
222
+ ```
223
+
224
+ **Windows PowerShell**:
225
+ ```powershell
226
+ # Set environment variables in PowerShell
227
+ $env:HCOM_TERMINAL_MODE="same_terminal"; hcom open agent-name
228
+ $env:HCOM_WAIT_TIMEOUT="60"; hcom open 3
229
+ $env:HCOM_INITIAL_PROMPT="go home buddy!"; hcom open
230
+ ```
231
+
232
+ ### Status Indicators
233
+
234
+ When running `hcom watch`, each instance shows its current state:
235
+
236
+ - ◉ **thinking** (cyan) - Processing input
237
+ - ▷ **responding** (green) - Generating text response
238
+ - ▶ **executing** (green) - Running tools
239
+ - ◉ **waiting** (blue) - Waiting for messages
240
+ - ■ **blocked** (yellow) - Permission blocked
241
+ - ○ **inactive** (red) - Timed out/dead
242
+ - **(bg)** suffix - Instance running in background headless mode
243
+
244
+ </details>
245
+
246
+ <details>
247
+ <summary><strong>🎲 How It Works</strong></summary>
248
+
249
+ ### Hooks!
250
+
251
+ hcom adds hooks to your project directory's `.claude/settings.local.json`:
252
+
253
+ 1. **Sending**: Claude agents use `echo "HCOM_SEND:message"` internally (you use `hcom send` from terminal or dashboard)
254
+ 2. **Receiving**: Other Claudes get notified via hooks (PostToolUse or Stop)
255
+ 3. **Waiting**: Stop hook keeps Claude in a waiting state for new messages
256
+
257
+ - **Identity**: Each instance gets a unique name based on session ID (e.g., "hovoa7")
258
+ - **Persistence**: Names persist across `--resume` maintaining conversation context
259
+ - **Status Detection**: Notification hook tracks permission requests and activity
260
+ - **Agents**: When you run `hcom open researcher`, it loads an interactive Claude session with a system prompt from `.claude/agents/researcher.md` (local) or `~/.claude/agents/researcher.md` (global). Specified `model:` and `tools:` are carried over
261
+
262
+ ### Architecture
263
+ - **Single conversation** - All instances share one global conversation
264
+ - **Opt-in participation** - Only Claude Code instances launched with `hcom open` join the chat
265
+ - **@-mention filtering** - Target messages to specific instances or teams
266
+
267
+ ### File Structure
268
+ ```plaintext
269
+ ~/.hcom/
270
+ ├── hcom.log # Conversation log
271
+ ├── instances/ # Instance tracking
272
+ ├── logs/ # Background process logs
273
+ ├── config.json # Configuration
274
+ └── archive/ # Archived sessions
275
+
276
+ your-project/
277
+ └── .claude/
278
+ └── settings.local.json # hcom hooks
279
+ ```
280
+
281
+ </details>
282
+
283
+
284
+ <details>
285
+ <summary><strong>🥔 Terminal Options</strong></summary>
286
+
287
+ ### Terminal Mode
288
+
289
+ Configure terminal behavior in `~/.hcom/config.json`:
290
+ - `"terminal_mode": "new_window"` - Opens new terminal window(s) (default)
291
+ - `"terminal_mode": "same_terminal"` - Opens in current terminal
292
+
293
+ #### Running in current terminal temporarily
294
+ ```bash
295
+ # For single instances
296
+ HCOM_TERMINAL_MODE=same_terminal hcom open
297
+ ```
298
+
299
+ ### Default Terminals
300
+
301
+ - **macOS**: Terminal.app
302
+ - **Linux**: gnome-terminal, konsole, or xterm
303
+ - **Windows & WSL**: Windows Terminal / Git Bash
304
+ - **Android**: Termux
305
+
306
+
307
+ ### Custom Terminals
308
+
309
+ Configure `terminal_command` in `~/.hcom/config.json` (permanent) or environment variables (temporary).
310
+
311
+ #### How to use this
312
+
313
+ The `{script}` placeholder is replaced by HCOM with the path to a temporary bash script that launches Claude Code.
314
+
315
+ Your custom command just needs to:
316
+ 1. Accept `{script}` as a placeholder that will be replaced with a script path
317
+ 2. Execute that script with bash
318
+
319
+ Example template: `your_terminal_command --execute "bash {script}"`
320
+
321
+ ### Custom Terminal Examples
322
+
323
+ #### iTerm2
324
+ ```json
325
+ "terminal_command": "open -a iTerm {script}"
326
+ ```
327
+
328
+ #### [ttab](https://github.com/mklement0/ttab) (new tab instead of new window in Terminal.app)
329
+ ```json
330
+ "terminal_command": "ttab {script}"
331
+ ```
332
+
333
+ #### [wttab](https://github.com/lalilaloe/wttab) (new tab in Windows Terminal)
334
+ ```json
335
+ "terminal_command": "wttab {script}"
336
+ ```
337
+
338
+ #### More
339
+ ```json
340
+ # WezTerm Linux/Windows
341
+ "terminal_command": "wezterm start -- bash {script}"
342
+
343
+ # Tabs from within WezTerm
344
+ "terminal_command": "wezterm cli spawn -- bash {script}"
345
+
346
+ # WezTerm macOS:
347
+ "terminal_command": "open -n -a WezTerm.app --args start -- bash {script}"
348
+
349
+ # Tabs from within WezTerm macOS
350
+ "terminal_command": "/Applications/WezTerm.app/Contents/MacOS/wezterm cli spawn -- bash {script}"
351
+
352
+ # Wave Terminal Mac/Linux/Windows. From within Wave Terminal:
353
+ "terminal_command": "wsh run -- bash {script}"
354
+
355
+ # Alacritty macOS:
356
+ "terminal_command": "open -n -a Alacritty.app --args -e bash {script}"
357
+
358
+ # Alacritty Linux:
359
+ "terminal_command": "alacritty -e bash {script}"
360
+
361
+ # Kitty macOS:
362
+ "terminal_command": "open -n -a kitty.app --args {script}"
363
+
364
+ # Kitty Linux
365
+ "terminal_command": "kitty {script}"
366
+ ```
367
+
368
+ #### tmux
369
+ ```json
370
+ "terminal_command": "tmux new-window -n hcom {script}"
371
+ ```
372
+ ```bash
373
+ # tmux commands work inside tmux, start a session with:
374
+ tmux new-session 'hcom open 3' # each instance opens in new tmux window
375
+
376
+ # Or one time split-panes:
377
+ # Start tmux with split panes and 3 claude instances in hcom chat
378
+ HCOM_TERMINAL_COMMAND="tmux split-window -h {script}" hcom open 3
379
+ ```
380
+
381
+ ### Android (Termux)
382
+
383
+ 1. Install [Termux](https://f-droid.org/packages/com.termux/) from F-Droid (not Google Play)
384
+ 2. Setup:
385
+ ```bash
386
+ pkg install python nodejs
387
+ npm install -g @anthropic-ai/claude-cli
388
+ pip install hcom
389
+ ```
390
+ 3. Enable:
391
+ ```bash
392
+ echo "allow-external-apps=true" >> ~/.termux/termux.properties
393
+ termux-reload-settings
394
+ ```
395
+ 4. Enable: "Display over other apps" permission for visible terminals
396
+
397
+ 5. Run: `hcom open`
398
+
399
+ ---
400
+
401
+ </details>
402
+
403
+
404
+ <details>
405
+ <summary><strong>⚗️ Remove</strong></summary>
406
+
407
+
408
+ ### Archive Conversation / Start New
409
+ ```bash
410
+ hcom clear
411
+ ```
412
+
413
+ ### Kill Running Instances
414
+ ```bash
415
+ # Kill specific instance
416
+ hcom kill hovoa7
417
+
418
+ # Kill all instances
419
+ hcom kill --all
420
+ ```
421
+
422
+ ### Remove HCOM hooks from current directory
423
+ ```bash
424
+ hcom cleanup
425
+ ```
426
+
427
+ ### Remove HCOM hooks from all directories
428
+ ```bash
429
+ hcom cleanup --all
430
+ ```
431
+
432
+ ### Remove hcom Completely
433
+ 1. Remove hcom: `rm /usr/local/bin/hcom` (or wherever you installed hcom)
434
+ 2. Remove all data: `rm -rf ~/.hcom`
435
+
436
+ </details>
437
+
438
+ ## 🦐 Requirements
439
+
440
+ - Python 3.7+
441
+ - [Claude Code](https://claude.ai/code)
442
+
443
+
444
+
445
+ ## 🌮 License
446
+
447
+ - MIT License
448
+
449
+ ---
@@ -0,0 +1,7 @@
1
+ hcom/__init__.py,sha256=jnDZJt18O1suCga9s5eFchG-doPpA0mGK4xBcJ0OJNk,96
2
+ hcom/__main__.py,sha256=_i5IjRCVvoLrq1JvgFN_SgBv7b8s-cJx1bUz8x97Ntw,123527
3
+ hcom-0.2.2.dist-info/METADATA,sha256=BoB4vN-QI4VE8pUiA8bawrw7l1lRbIN2bPS6TzbEr-s,15834
4
+ hcom-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ hcom-0.2.2.dist-info/entry_points.txt,sha256=cz9K9PsgYmORUxNKxVRrpxLS3cxRJcDZkE-PpfvOhI8,44
6
+ hcom-0.2.2.dist-info/top_level.txt,sha256=8AS1nVUWA26vxjDQ5viRxgJnwSvUWk1W6GP4g6ldZ-0,5
7
+ hcom-0.2.2.dist-info/RECORD,,