hcom 0.3.1__tar.gz → 0.4.2.post3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcom
3
- Version: 0.3.1
3
+ Version: 0.4.2.post3
4
4
  Summary: CLI tool for launching multiple Claude Code terminals with interactive subagents, headless persistence, and real-time communication via hooks
5
5
  Author: aannoo
6
6
  License-Expression: MIT
@@ -38,52 +38,56 @@ CLI tool for launching multiple Claude Code terminals with interactive [subagent
38
38
 
39
39
  **Run without installing** ([uv](https://docs.astral.sh/uv/#installation))
40
40
  ```bash
41
- uvx hcom open 2
41
+ uvx hcom 2
42
42
  ```
43
43
 
44
- **Install** (optional)
44
+ **Install**
45
45
  ```bash
46
- pip install hcom
47
- hcom open 2
46
+ pip install hcom # or: uv tool install hcom
47
+ # then:
48
+ hcom 2 # or tell claude to run hcom start
48
49
  ```
49
50
 
50
51
  | Commands | |
51
52
  |---------|-------------|
52
- | `hcom open [n]` | Launch `n` instances or named agents |
53
+ | `hcom <n>` | Launch `n` instances (default 1) |
53
54
  | `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 |
55
+ | `hcom stop` | Disable hcom chat for instance |
56
+ | `hcom start` | Enable hcom chat for instance |
57
+ | `hcom reset` | Stop all + archive logs + remove hooks + clear config |
58
+
56
59
 
57
60
 
58
61
  ## 🦆 What It Does
59
62
 
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.
63
+ `hcom` adds hooks to `~/.claude/settings.json` 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, but can opt-in via `hcom start` and opt-out with `hcom stop`.
64
+
61
65
 
62
- ### Subagents in their own terminal
66
+ ### Interactive subagents in their own terminal
63
67
  ```bash
64
68
  # Launch subagents from your .claude/agents
65
- hcom open planner code-writer reviewer
69
+ HCOM_AGENT=planner,code-writer,reviewer hcom 1
66
70
  ```
67
71
 
68
72
  ### Persistent headless instances
69
73
  ```bash
70
- # Launch one headless instance (default 30min timeout)
71
- hcom open -p
74
+ hcom 1 claude -p # Launch one headless instance (default 30min timeout)
75
+ hcom watch # See what it's doing
76
+ hcom stop # Let it die earlier than timeout
72
77
  ```
73
78
 
74
79
  ### Groups and direct messages
75
80
  ```bash
76
- hcom open --prefix cool # Creates cool-hovoa7
77
- hcom open --prefix cool # Creates cool-homab8
81
+ HCOM_TAG=cool hcom 2 # Creates cool-hovoa7 & cool-homab8
78
82
  hcom send '@cool hi, you are cool'
79
83
  hcom send '@homab8 hi, you are cooler'
80
84
  ```
81
85
 
82
- ### Persistent thinking mode
86
+ ### Toggle HCOM in Claude Code
83
87
  ```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
88
+ claude # Start normal Claude Code
89
+ 'run hcom start' # Start HCOM for this instance to receive messages
90
+ 'run hcom stop' # Stop HCOM for this instance, continue as normal claude code
87
91
  ```
88
92
 
89
93
  ---
@@ -107,26 +111,48 @@ HCOM_INITIAL_PROMPT="ultrathink and do x" hcom open
107
111
  <details>
108
112
  <summary><strong>🥨 All Commands</strong></summary>
109
113
 
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 |
114
+ ```bash
115
+ Usage: [ENV_VARS] hcom <COUNT> [claude <ARGS>...]
116
+ hcom watch [--logs|--status|--wait [SEC]]
117
+ hcom send "message"
118
+ hcom stop [alias|all] [--force]
119
+ hcom start [alias]
120
+
121
+ Launch Examples:
122
+ hcom 3 Open 3 terminals with claude connected to hcom
123
+ hcom 3 claude -p + Background/headless
124
+ HCOM_TAG=api hcom 3 claude -p + @-mention group tag
125
+ claude 'run hcom start' claude code with prompt will also work
126
+
127
+ Commands:
128
+ watch Interactive messaging/status dashboard
129
+ --logs Print all messages
130
+ --status Print instance status JSON
131
+ --wait [SEC] Wait and notify for new message
132
+
133
+ send "msg" Send message to all instances
134
+ send "@alias msg" Send to specific instance/group
135
+
136
+ stop Stop current instance (from inside Claude)
137
+ stop <alias> Stop specific instance
138
+ stop all Stop all instances
139
+ --force Emergency stop (denies Bash tool)
140
+
141
+ start Start current instance (from inside Claude)
142
+ start <alias> Start specific instance
143
+
144
+ reset Stop all + archive logs + remove hooks + clear config
145
+ reset logs Clear + archive conversation log
146
+ reset hooks Safely remove hcom hooks from claude settings.json
147
+ reset config Clear + backup config.env
148
+
149
+ Environment Variables:
150
+ HCOM_TAG=name Group tag (creates name-* instances)
151
+ HCOM_AGENT=type Agent type (comma-separated for multiple)
152
+ HCOM_TERMINAL=mode Terminal: new|here|print|"custom {script}"
153
+ HCOM_PROMPT=text Initial prompt
154
+ HCOM_TIMEOUT=secs Timeout in seconds (default: 1800)
155
+ ```
130
156
 
131
157
  </details>
132
158
 
@@ -136,35 +162,29 @@ HCOM_INITIAL_PROMPT="ultrathink and do x" hcom open
136
162
  <summary><strong>🗿 Examples</strong></summary>
137
163
 
138
164
  ```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
165
+ # Launch 3 headless instances that time out after 60 seconds of inactivity
166
+ HCOM_TIMEOUT=60 hcom 3 claude -p
167
+ # Stop all instances
168
+ hcom stop all
153
169
 
154
170
  # Launch multiple of the same subagent
155
- hcom open reviewer reviewer reviewer
171
+ HCOM_AGENT=reviewer hcom 3
156
172
 
157
- # Launch agent with specific prompt
158
- HCOM_INITIAL_PROMPT='write tests' hcom open test-writer
173
+ # Launch mixed agents with team tag
174
+ HCOM_TAG=api HCOM_AGENT=backend,frontend hcom 1
159
175
 
160
- # Resume instance (hcom chat will continue)
161
- hcom open --claude-args "--resume session_id"
176
+ # Launch instance with specific prompt
177
+ HCOM_PROMPT='write tests' HCOM_AGENT=test-writer hcom 1
162
178
 
163
- # Text appended to all messages recieved by instance
164
- HCOM_INSTANCE_HINTS="remember where you came from" hcom open
179
+ # Pass claude args
180
+ hcom 1 claude --resume session_id # Resume instance (hcom chat continues)
165
181
 
166
- # Pass multiple Claude flags
167
- hcom open orchestrator --claude-args "--model sonnet --resume session_id"
182
+ # Text appended to all messages received by instance
183
+ HCOM_HINTS="remember where you came from" hcom 1
184
+
185
+ # Start hcom communication with shared context forked from a checkpoint
186
+ HCOM_TAG=clone hcom 3 claude --resume session_id --fork-session
187
+ # Creates: clone-skal7, clone-hova3, clone-koe2. Mention all: @clone
168
188
  ```
169
189
 
170
190
  </details>
@@ -174,59 +194,40 @@ hcom open orchestrator --claude-args "--model sonnet --resume session_id"
174
194
 
175
195
  ### Configuration
176
196
 
177
- Settings can be changed two ways:
178
-
179
- #### Method 1: Environment variable (temporary, per-command/instance)
197
+ Config file: `~/.hcom/config.env`
180
198
 
199
+ All HCOM_* settings work from config file (persistent) or environment variable (temporary). Environment variables override config file.
181
200
 
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)
201
+ | Setting | Description | Default |
202
+ |---------|-------------|---------|
203
+ | `HCOM_TIMEOUT` | Instance wait timeout (1-86400 seconds) | 1800 |
204
+ | `HCOM_TERMINAL` | Terminal mode: `new`, `here`, `print`, or custom `{script}` | `new` |
205
+ | `HCOM_PROMPT` | Initial prompt for new instances | `say hi in hcom chat` |
206
+ | `HCOM_HINTS` | Text appended to all messages | (empty) |
207
+ | `HCOM_TAG` | Group tag (creates tag-* instances) | (empty) |
208
+ | `HCOM_AGENT` | Agent type, comma-separated | `generic` |
187
209
 
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 |
210
+ Any other environment variables in config.env are passed to Claude Code instances (e.g., ANTHROPIC_MODEL).
207
211
 
208
212
  ### Examples
209
213
 
210
214
  ```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
215
+ # Temporary override for one command
216
+ HCOM_TIMEOUT=60 hcom 3
216
217
 
217
- # Custom welcome message
218
- HCOM_FIRST_USE_TEXT="Debug session for issue #123" hcom open 2
218
+ # Set persistent config
219
+ echo "HCOM_TIMEOUT=60" >> ~/.hcom/config.env
220
+ echo "HCOM_TERMINAL=here" >> ~/.hcom/config.env
219
221
 
220
- # Bigger delivery batches
221
- HCOM_MAX_MESSAGES_PER_DELIVERY=100 hcom watch --logs
222
+ # Pass Claude Code env vars
223
+ ANTHROPIC_MODEL=opus hcom 3
222
224
  ```
223
225
 
224
226
  **Windows PowerShell**:
225
227
  ```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
228
+ # Temporary environment variable
229
+ $env:HCOM_TERMINAL="here"; hcom 1
230
+ $env:HCOM_TIMEOUT="60"; hcom 3
230
231
  ```
231
232
 
232
233
  ### Status Indicators
@@ -237,8 +238,8 @@ When running `hcom watch`, each instance shows its current state:
237
238
  - ▷ **delivered** (cyan) - Just received a message
238
239
  - ◉ **waiting** (blue) - Waiting for messages
239
240
  - ■ **blocked** (yellow) - Permission request pending
240
- - ○ **inactive** (red) - Timed out/disconnected
241
- - ○ **unknown** (gray) - No status data
241
+ - ○ **inactive** (red) - Closed/timed out/ended
242
+ - ○ **unknown** (gray) - No status data or stale
242
243
  - **(bg)** suffix - Instance running in background headless mode
243
244
 
244
245
  </details>
@@ -248,34 +249,33 @@ When running `hcom watch`, each instance shows its current state:
248
249
 
249
250
  ### Hooks!
250
251
 
251
- hcom adds hooks to your project directory's `.claude/settings.local.json`:
252
+ hcom adds hooks to `~/.claude/settings.json`:
252
253
 
253
- 1. **Sending**: Claude agents use `eval $HCOM send "message"` internally (you use `hcom send` from terminal or dashboard)
254
+ 1. **Sending**: Claude uses `hcom send "message"` to communicate
254
255
  2. **Receiving**: Other Claudes get notified via Stop hook or immediate delivery after sending
255
256
  3. **Waiting**: Stop hook keeps Claude in a waiting state for new messages
256
257
 
257
258
  - **Identity**: Each instance gets a unique name based on session ID (e.g., "hovoa7")
258
259
  - **Persistence**: Names persist across `--resume` maintaining conversation context
259
260
  - **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
+ - **Agents**: When you run `HCOM_AGENT=researcher hcom 1`, 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
 
262
263
  ### Architecture
263
264
  - **Single conversation** - All instances share one global conversation
264
- - **Opt-in participation** - Only Claude Code instances launched with `hcom open` join the chat
265
+ - **Opt-in participation** - Only Claude Code instances launched with `hcom` join automatically, normal instances can use `hcom start`/`stop`
265
266
  - **@-mention filtering** - Target messages to specific instances or teams
266
267
 
267
268
  ### File Structure
268
269
  ```plaintext
269
- ~/.hcom/
270
+ ~/.hcom/
270
271
  ├── hcom.log # Conversation log
271
272
  ├── instances/ # Instance tracking
272
273
  ├── logs/ # Background process logs
273
- ├── config.json # Configuration
274
+ ├── config.env # Configuration
274
275
  └── archive/ # Archived sessions
275
276
 
276
- your-project/
277
- └── .claude/
278
- └── settings.local.json # hcom hooks
277
+ ~/.claude/
278
+ └── settings.json # hcom hooks (global)
279
279
  ```
280
280
 
281
281
  </details>
@@ -286,14 +286,15 @@ your-project/
286
286
 
287
287
  ### Terminal Mode
288
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
289
+ Configure terminal behavior in `~/.hcom/config.env`:
290
+ - `HCOM_TERMINAL=new` - Opens new terminal window(s) (default)
291
+ - `HCOM_TERMINAL=here` - Opens in current terminal
292
+ - `HCOM_TERMINAL=print` - Prints commands instead of launching
292
293
 
293
294
  #### Running in current terminal temporarily
294
295
  ```bash
295
296
  # For single instances
296
- HCOM_TERMINAL_MODE=same_terminal hcom open
297
+ HCOM_TERMINAL=here hcom 1
297
298
  ```
298
299
 
299
300
  ### Default Terminals
@@ -306,7 +307,7 @@ HCOM_TERMINAL_MODE=same_terminal hcom open
306
307
 
307
308
  ### Custom Terminals
308
309
 
309
- Configure `terminal_command` in `~/.hcom/config.json` (permanent) or environment variables (temporary).
310
+ Configure in `~/.hcom/config.env` (permanent) or environment variables (temporary).
310
311
 
311
312
  #### How to use this
312
313
 
@@ -321,61 +322,61 @@ Example template: `your_terminal_command --execute "bash {script}"`
321
322
  ### Custom Terminal Examples
322
323
 
323
324
  #### iTerm2
324
- ```json
325
- "terminal_command": "open -a iTerm {script}"
325
+ ```bash
326
+ HCOM_TERMINAL="open -a iTerm {script}"
326
327
  ```
327
328
 
328
329
  #### [ttab](https://github.com/mklement0/ttab) (new tab instead of new window in Terminal.app)
329
- ```json
330
- "terminal_command": "ttab {script}"
330
+ ```bash
331
+ HCOM_TERMINAL="ttab {script}"
331
332
  ```
332
333
 
333
334
  #### [wttab](https://github.com/lalilaloe/wttab) (new tab in Windows Terminal)
334
- ```json
335
- "terminal_command": "wttab {script}"
335
+ ```bash
336
+ HCOM_TERMINAL="wttab {script}"
336
337
  ```
337
338
 
338
339
  #### More
339
- ```json
340
+ ```bash
340
341
  # WezTerm Linux/Windows
341
- "terminal_command": "wezterm start -- bash {script}"
342
+ HCOM_TERMINAL="wezterm start -- bash {script}"
342
343
 
343
344
  # Tabs from within WezTerm
344
- "terminal_command": "wezterm cli spawn -- bash {script}"
345
+ HCOM_TERMINAL="wezterm cli spawn -- bash {script}"
345
346
 
346
347
  # WezTerm macOS:
347
- "terminal_command": "open -n -a WezTerm.app --args start -- bash {script}"
348
+ HCOM_TERMINAL="open -n -a WezTerm.app --args start -- bash {script}"
348
349
 
349
350
  # Tabs from within WezTerm macOS
350
- "terminal_command": "/Applications/WezTerm.app/Contents/MacOS/wezterm cli spawn -- bash {script}"
351
+ HCOM_TERMINAL="/Applications/WezTerm.app/Contents/MacOS/wezterm cli spawn -- bash {script}"
351
352
 
352
353
  # Wave Terminal Mac/Linux/Windows. From within Wave Terminal:
353
- "terminal_command": "wsh run -- bash {script}"
354
+ HCOM_TERMINAL="wsh run -- bash {script}"
354
355
 
355
356
  # Alacritty macOS:
356
- "terminal_command": "open -n -a Alacritty.app --args -e bash {script}"
357
+ HCOM_TERMINAL="open -n -a Alacritty.app --args -e bash {script}"
357
358
 
358
359
  # Alacritty Linux:
359
- "terminal_command": "alacritty -e bash {script}"
360
+ HCOM_TERMINAL="alacritty -e bash {script}"
360
361
 
361
362
  # Kitty macOS:
362
- "terminal_command": "open -n -a kitty.app --args {script}"
363
+ HCOM_TERMINAL="open -n -a kitty.app --args {script}"
363
364
 
364
365
  # Kitty Linux
365
- "terminal_command": "kitty {script}"
366
+ HCOM_TERMINAL="kitty {script}"
366
367
  ```
367
368
 
368
369
  #### tmux
369
- ```json
370
- "terminal_command": "tmux new-window -n hcom {script}"
370
+ ```bash
371
+ HCOM_TERMINAL="tmux new-window -n hcom {script}"
371
372
  ```
372
373
  ```bash
373
374
  # tmux commands work inside tmux, start a session with:
374
- tmux new-session 'hcom open 3' # each instance opens in new tmux window
375
+ tmux new-session 'hcom 3' # each instance opens in new tmux window
375
376
 
376
377
  # Or one time split-panes:
377
378
  # 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
+ HCOM_TERMINAL="tmux split-window -h {script}" hcom 3
379
380
  ```
380
381
 
381
382
  ### Android (Termux)
@@ -394,7 +395,7 @@ HCOM_TERMINAL_COMMAND="tmux split-window -h {script}" hcom open 3
394
395
  ```
395
396
  4. Enable: "Display over other apps" permission for visible terminals
396
397
 
397
- 5. Run: `hcom open`
398
+ 5. Run: `hcom 1`
398
399
 
399
400
  ---
400
401
 
@@ -407,26 +408,28 @@ HCOM_TERMINAL_COMMAND="tmux split-window -h {script}" hcom open 3
407
408
 
408
409
  ### Archive Conversation / Start New
409
410
  ```bash
410
- hcom clear
411
+ hcom stop all
411
412
  ```
412
413
 
413
- ### Kill Running Instances
414
+ ### Stop Running Instances
414
415
  ```bash
415
- # Kill specific instance
416
- hcom kill hovoa7
416
+ # Stop specific instance
417
+ hcom stop hovoa7
417
418
 
418
- # Kill all instances
419
- hcom kill --all
419
+ # Stop all and archive
420
+ hcom stop all
420
421
  ```
421
422
 
422
- ### Remove HCOM hooks from current directory
423
+ ### Start Stopped Instances
423
424
  ```bash
424
- hcom cleanup
425
+ # Start specific instance
426
+ hcom start hovoa7
425
427
  ```
426
428
 
427
- ### Remove HCOM hooks from all directories
429
+ ### Remove HCOM hooks
428
430
  ```bash
429
- hcom cleanup --all
431
+ # Stop all, archive conversation, remove hooks, clear config
432
+ hcom reset
430
433
  ```
431
434
 
432
435
  ### Remove hcom Completely