hcom 0.1.6__tar.gz → 0.1.8__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.

Potentially problematic release.


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

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcom
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Lightweight CLI tool for real-time communication between Claude Code subagents using hooks
5
5
  Author-email: aannoo <your@email.com>
6
6
  License: MIT
@@ -92,7 +92,7 @@ hcom open test-writer --claude-args "-p 'write tests for any new code'"
92
92
  hcom open reviewer --claude-args "-p 'review when @mentioned'"
93
93
 
94
94
  # Pass multiple Claude flags
95
- hcom open orchestrator --claude-args "--model claude-3-opus
95
+ hcom open orchestrator --claude-args "--model sonnet
96
96
  --resume session_id"
97
97
 
98
98
  # Launch in specific directories
@@ -100,11 +100,12 @@ cd backend && hcom open api-specialist
100
100
  cd ../frontend && hcom open ui-specialist
101
101
 
102
102
  # Create named teams that can be @mentioned
103
- cd ~/api && hcom open --prefix api debugger
104
- cd ~/auth && hcom open --prefix auth debugger
103
+ cd ~/api && hcom open --prefix api debugger # Creates api-hovoa7
104
+ cd ~/auth && hcom open --prefix auth debugger # Creates auth-hovob8
105
105
 
106
- # Message specific teams
107
- hcom send "@api login works but API fails" # or in dashboard: hcom watch
106
+ # Message specific teams or instances
107
+ hcom send "@api login works but API fails" # Messages all api-* instances
108
+ hcom send "@hovoa7 can you check this?" # Message specific instance by name
108
109
  ```
109
110
 
110
111
 
@@ -120,7 +121,7 @@ hcom send "@api login works but API fails" # or in dashboard: hcom watch
120
121
  ### Automation Commands
121
122
  | Command | Description |
122
123
  |---------|-------------|
123
- | `hcom send 'message'` | Send message |
124
+ | `hcom send 'message'` | Send message to chat |
124
125
  | `hcom watch --logs` | View message history (non-interactive) |
125
126
  | `hcom watch --status` | Show instance status (non-interactive) |
126
127
  | `hcom watch --wait [timeout]` | Wait and notify for new messages |
@@ -195,7 +196,7 @@ HCOM_MAX_MESSAGE_SIZE=8192 hcom send "$(cat long_report.txt)"
195
196
 
196
197
  hcom adds hooks to your project directory's `.claude/settings.local.json`:
197
198
 
198
- 1. **Sending**: Claude writes messages with `echo "HCOM_SEND:message"` - captured by PostToolUse hook
199
+ 1. **Sending**: Claude agents use `echo "HCOM_SEND:message"` internally (you use `hcom send` from terminal)
199
200
  2. **Receiving**: Other Claudes get notified via Stop hook
200
201
  3. **Waiting**: Stop hook keeps Claude in a waiting state for new messages
201
202
 
@@ -64,7 +64,7 @@ hcom open test-writer --claude-args "-p 'write tests for any new code'"
64
64
  hcom open reviewer --claude-args "-p 'review when @mentioned'"
65
65
 
66
66
  # Pass multiple Claude flags
67
- hcom open orchestrator --claude-args "--model claude-3-opus
67
+ hcom open orchestrator --claude-args "--model sonnet
68
68
  --resume session_id"
69
69
 
70
70
  # Launch in specific directories
@@ -72,11 +72,12 @@ cd backend && hcom open api-specialist
72
72
  cd ../frontend && hcom open ui-specialist
73
73
 
74
74
  # Create named teams that can be @mentioned
75
- cd ~/api && hcom open --prefix api debugger
76
- cd ~/auth && hcom open --prefix auth debugger
75
+ cd ~/api && hcom open --prefix api debugger # Creates api-hovoa7
76
+ cd ~/auth && hcom open --prefix auth debugger # Creates auth-hovob8
77
77
 
78
- # Message specific teams
79
- hcom send "@api login works but API fails" # or in dashboard: hcom watch
78
+ # Message specific teams or instances
79
+ hcom send "@api login works but API fails" # Messages all api-* instances
80
+ hcom send "@hovoa7 can you check this?" # Message specific instance by name
80
81
  ```
81
82
 
82
83
 
@@ -92,7 +93,7 @@ hcom send "@api login works but API fails" # or in dashboard: hcom watch
92
93
  ### Automation Commands
93
94
  | Command | Description |
94
95
  |---------|-------------|
95
- | `hcom send 'message'` | Send message |
96
+ | `hcom send 'message'` | Send message to chat |
96
97
  | `hcom watch --logs` | View message history (non-interactive) |
97
98
  | `hcom watch --status` | Show instance status (non-interactive) |
98
99
  | `hcom watch --wait [timeout]` | Wait and notify for new messages |
@@ -167,7 +168,7 @@ HCOM_MAX_MESSAGE_SIZE=8192 hcom send "$(cat long_report.txt)"
167
168
 
168
169
  hcom adds hooks to your project directory's `.claude/settings.local.json`:
169
170
 
170
- 1. **Sending**: Claude writes messages with `echo "HCOM_SEND:message"` - captured by PostToolUse hook
171
+ 1. **Sending**: Claude agents use `echo "HCOM_SEND:message"` internally (you use `hcom send` from terminal)
171
172
  2. **Receiving**: Other Claudes get notified via Stop hook
172
173
  3. **Waiting**: Stop hook keeps Claude in a waiting state for new messages
173
174
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hcom"
7
- version = "0.1.6"
7
+ version = "0.1.8"
8
8
  description = "Lightweight CLI tool for real-time communication between Claude Code subagents using hooks"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.6"
@@ -1,3 +1,3 @@
1
1
  """Claude Hook Comms - Real-time messaging between Claude Code agents."""
2
2
 
3
- __version__ = "0.1.5"
3
+ __version__ = "0.1.8"
@@ -262,7 +262,7 @@ def send_message(from_instance, message):
262
262
  except Exception:
263
263
  return False
264
264
 
265
- def should_deliver_message(msg, instance_name):
265
+ def should_deliver_message(msg, instance_name, all_instance_names=None):
266
266
  """Check if message should be delivered based on @-mentions"""
267
267
  text = msg['message']
268
268
 
@@ -274,11 +274,22 @@ def should_deliver_message(msg, instance_name):
274
274
  if not mentions:
275
275
  return True
276
276
 
277
- for mention in mentions:
278
- if instance_name.lower().startswith(mention.lower()):
279
- return True
277
+ # Check if this instance matches any mention
278
+ this_instance_matches = any(instance_name.lower().startswith(mention.lower()) for mention in mentions)
279
+
280
+ if this_instance_matches:
281
+ return True
282
+
283
+ # If we have all_instance_names, check if ANY mention matches ANY instance
284
+ if all_instance_names:
285
+ any_mention_matches = any(
286
+ any(name.lower().startswith(mention.lower()) for name in all_instance_names)
287
+ for mention in mentions
288
+ )
289
+ if not any_mention_matches:
290
+ return True # No matches anywhere = broadcast to all
280
291
 
281
- return False
292
+ return False # This instance doesn't match, but others might
282
293
 
283
294
  # ==================== Parsing and Helper Functions ====================
284
295
 
@@ -713,7 +724,7 @@ def setup_hooks():
713
724
  if 'hooks' not in settings:
714
725
  settings['hooks'] = {}
715
726
 
716
- hcom_send_permission = 'Bash(echo "HCOM_SEND:*")'
727
+ hcom_send_permission = 'Bash(echo HCOM_SEND:*)'
717
728
  if hcom_send_permission not in settings['permissions']['allow']:
718
729
  settings['permissions']['allow'].append(hcom_send_permission)
719
730
 
@@ -885,10 +896,11 @@ def get_new_messages(instance_name):
885
896
  # Filter messages:
886
897
  # 1. Exclude own messages
887
898
  # 2. Apply @-mention filtering
899
+ all_instance_names = list(positions.keys())
888
900
  messages = []
889
901
  for msg in all_messages:
890
902
  if msg['from'] != instance_name:
891
- if should_deliver_message(msg, instance_name):
903
+ if should_deliver_message(msg, instance_name, all_instance_names):
892
904
  messages.append(msg)
893
905
 
894
906
  # Update position to end of file
@@ -1280,22 +1292,73 @@ def show_main_screen_header():
1280
1292
 
1281
1293
  def cmd_help():
1282
1294
  """Show help text"""
1295
+ # Basic help for interactive users
1283
1296
  print("""hcom - Claude Hook Comms
1284
1297
 
1285
1298
  Usage:
1286
1299
  hcom open [n] Launch n Claude instances
1287
- hcom open --prefix name n Launch with name prefix
1300
+ hcom open <agent> Launch named agent from .claude/agents/
1301
+ hcom open --prefix <team> n Launch n instances with team prefix
1288
1302
  hcom watch View conversation dashboard
1289
- hcom clear Clear and archive conversation
1290
- hcom cleanup Remove hooks from current directory
1291
- hcom cleanup --all Remove hooks from all tracked directories
1292
- hcom help Show this help
1303
+ hcom clear Clear and archive conversation
1304
+ hcom cleanup Remove hooks from current directory
1305
+ hcom cleanup --all Remove hooks from all tracked directories
1306
+ hcom help Show this help
1293
1307
 
1294
1308
  Automation:
1295
- hcom send 'msg' Send message
1296
- hcom send '@prefix msg' Send to specific instances
1297
- hcom watch --logs Show logs
1298
- hcom watch --status Show status""")
1309
+ hcom send 'msg' Send message to all
1310
+ hcom send '@prefix msg' Send to specific instances
1311
+ hcom watch --logs Show logs
1312
+ hcom watch --status Show status
1313
+ hcom watch --wait [timeout] Wait and notify for new messages (seconds)
1314
+
1315
+ Docs: https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/README.md""")
1316
+
1317
+ # Additional help for AI assistants when running in non-interactive mode
1318
+ if not sys.stdin.isatty():
1319
+ print("""
1320
+
1321
+ === ADDITIONAL INFO ===
1322
+
1323
+ CONCEPT: HCOM creates multi-agent collaboration by launching multiple Claude Code
1324
+ instances in separate terminals that share a single conversation.
1325
+
1326
+ KEY UNDERSTANDING:
1327
+ • Single conversation - All instances share ~/.hcom/hcom.log
1328
+ • Agents are system prompts - "reviewer" loads .claude/agents/reviewer.md
1329
+ • CLI usage - Use 'hcom send' for messaging. Internal instances use 'echo HCOM_SEND:'
1330
+ • hcom open is directory-specific - always cd to project directory first
1331
+
1332
+ LAUNCH PATTERNS:
1333
+ hcom open 2 reviewer # 2 generic + 1 reviewer agent
1334
+ hcom open reviewer reviewer # 2 separate reviewer instances
1335
+ hcom open --prefix api 2 # Team naming: api-hova7, api-kolec
1336
+ hcom open test --claude-args "-p 'write tests'" # Pass 'claude' CLI flags
1337
+
1338
+ @MENTION TARGETING:
1339
+ hcom send "message" # Broadcasts to everyone
1340
+ hcom send "@api fix this" # Targets all api-* instances (api-hova7, api-kolec)
1341
+ hcom send "@hova7 status?" # Targets specific instance
1342
+ (Unmatched @mentions broadcast to everyone)
1343
+
1344
+ STATUS INDICATORS:
1345
+ • ◉ thinking, ▷ responding, ▶ executing - instance is working
1346
+ • ◉ waiting - instance is waiting for new messages (hcom send)
1347
+ • ■ blocked - instance is blocked by permission request (needs user approval)
1348
+ • ○ inactive - instance is inactive (timed out, disconnected, etc)
1349
+
1350
+ CONFIG:
1351
+ Environment overrides (temporary): HCOM_INSTANCE_HINTS="useful info" hcom send "hi"
1352
+ Config file (persistent): ~/.hcom/config.json
1353
+
1354
+ Key settings (all in config.json):
1355
+ terminal_mode: "new_window" | "same_terminal" | "show_commands"
1356
+ initial_prompt: "Say hi in chat", first_use_text: "Essential, concise messages only..."
1357
+ instance_hints: "", cli_hints: "" # Extra info for instances/CLI
1358
+
1359
+ EXPECT: Instance names are auto-generated (5-char format based on uuid: "hova7"). Check actual names
1360
+ with 'hcom watch --status'. Instances respond automatically in shared chat.""")
1361
+
1299
1362
  return 0
1300
1363
 
1301
1364
  def cmd_open(*args):
@@ -1783,6 +1846,19 @@ def cmd_send(message):
1783
1846
  print(f"Error: {error}", file=sys.stderr)
1784
1847
  return 1
1785
1848
 
1849
+ # Check for unmatched mentions (minimal warning)
1850
+ mentions = MENTION_PATTERN.findall(message)
1851
+ if mentions and pos_file.exists():
1852
+ try:
1853
+ positions = load_positions(pos_file)
1854
+ all_instances = list(positions.keys())
1855
+ unmatched = [m for m in mentions
1856
+ if not any(name.lower().startswith(m.lower()) for name in all_instances)]
1857
+ if unmatched:
1858
+ print(f"Note: @{', @'.join(unmatched)} don't match any instances - broadcasting to all")
1859
+ except Exception:
1860
+ pass # Don't fail on warning
1861
+
1786
1862
  # Send message
1787
1863
  sender_name = get_config_value('sender_name', 'bigboss')
1788
1864
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcom
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Lightweight CLI tool for real-time communication between Claude Code subagents using hooks
5
5
  Author-email: aannoo <your@email.com>
6
6
  License: MIT
@@ -92,7 +92,7 @@ hcom open test-writer --claude-args "-p 'write tests for any new code'"
92
92
  hcom open reviewer --claude-args "-p 'review when @mentioned'"
93
93
 
94
94
  # Pass multiple Claude flags
95
- hcom open orchestrator --claude-args "--model claude-3-opus
95
+ hcom open orchestrator --claude-args "--model sonnet
96
96
  --resume session_id"
97
97
 
98
98
  # Launch in specific directories
@@ -100,11 +100,12 @@ cd backend && hcom open api-specialist
100
100
  cd ../frontend && hcom open ui-specialist
101
101
 
102
102
  # Create named teams that can be @mentioned
103
- cd ~/api && hcom open --prefix api debugger
104
- cd ~/auth && hcom open --prefix auth debugger
103
+ cd ~/api && hcom open --prefix api debugger # Creates api-hovoa7
104
+ cd ~/auth && hcom open --prefix auth debugger # Creates auth-hovob8
105
105
 
106
- # Message specific teams
107
- hcom send "@api login works but API fails" # or in dashboard: hcom watch
106
+ # Message specific teams or instances
107
+ hcom send "@api login works but API fails" # Messages all api-* instances
108
+ hcom send "@hovoa7 can you check this?" # Message specific instance by name
108
109
  ```
109
110
 
110
111
 
@@ -120,7 +121,7 @@ hcom send "@api login works but API fails" # or in dashboard: hcom watch
120
121
  ### Automation Commands
121
122
  | Command | Description |
122
123
  |---------|-------------|
123
- | `hcom send 'message'` | Send message |
124
+ | `hcom send 'message'` | Send message to chat |
124
125
  | `hcom watch --logs` | View message history (non-interactive) |
125
126
  | `hcom watch --status` | Show instance status (non-interactive) |
126
127
  | `hcom watch --wait [timeout]` | Wait and notify for new messages |
@@ -195,7 +196,7 @@ HCOM_MAX_MESSAGE_SIZE=8192 hcom send "$(cat long_report.txt)"
195
196
 
196
197
  hcom adds hooks to your project directory's `.claude/settings.local.json`:
197
198
 
198
- 1. **Sending**: Claude writes messages with `echo "HCOM_SEND:message"` - captured by PostToolUse hook
199
+ 1. **Sending**: Claude agents use `echo "HCOM_SEND:message"` internally (you use `hcom send` from terminal)
199
200
  2. **Receiving**: Other Claudes get notified via Stop hook
200
201
  3. **Waiting**: Stop hook keeps Claude in a waiting state for new messages
201
202
 
File without changes
File without changes
File without changes