hcom 0.1.5__tar.gz → 0.1.7__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,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcom
3
- Version: 0.1.5
4
- Summary: Lightweight CLI tool for real-time messaging between Claude Code subagents using hooks
3
+ Version: 0.1.7
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
7
7
  Project-URL: Homepage, https://github.com/aannoo/claude-hook-comms
@@ -26,9 +26,9 @@ Classifier: Topic :: Communications
26
26
  Requires-Python: >=3.6
27
27
  Description-Content-Type: text/markdown
28
28
 
29
- # Claude Code Hook Comms
29
+ # hcom - Claude Hook Comms
30
30
 
31
- Lightweight CLI tool for real-time communication between claude code [subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents) using [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
31
+ Lightweight CLI tool for real-time communication between Claude Code [subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents) using [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
32
32
 
33
33
  ## 🦆 What It Does
34
34
 
@@ -38,7 +38,7 @@ Creates a group chat where you and multiple interactive Claude Code subagents ca
38
38
 
39
39
  ## 🦷 Features
40
40
 
41
- - **Multi-Terminal Launch** - Launch claude code subagents in new terminals
41
+ - **Multi-Terminal Launch** - Launch Claude Code subagents in new terminals
42
42
  - **Live Dashboard** - Real-time monitoring of all instances
43
43
  - **Multi-Agent Communication** - Claude instances talk to each other across projects
44
44
  - **@Mention Targeting** - Send messages to specific subagents or teams
@@ -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,18 +196,18 @@ 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
 
202
203
  - **Identity**: Each instance gets a unique name based on conversation UUID (e.g., "hovoa7")
203
204
  - **Persistence**: Names persist across `--resume` maintaining conversation context
204
205
  - **Status Detection**: Notification hook tracks permission requests and activity
205
- - **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). Agents can specify `model:` and `tools:` in YAML frontmatter
206
+ - **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). Agents can specify `model:` and `tools:` in YAML frontmatter
206
207
 
207
208
  ### Architecture
208
209
  - **Single conversation** - All instances share one global conversation
209
- - **Opt-in participation** - Only claude code instances launched with `hcom open` join the chat
210
+ - **Opt-in participation** - Only Claude Code instances launched with `hcom open` join the chat
210
211
  - **@-mention filtering** - Target messages to specific instances or teams
211
212
 
212
213
  ### File Structure
@@ -1,6 +1,6 @@
1
- # Claude Code Hook Comms
1
+ # hcom - Claude Hook Comms
2
2
 
3
- Lightweight CLI tool for real-time communication between claude code [subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents) using [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
3
+ Lightweight CLI tool for real-time communication between Claude Code [subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents) using [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
4
4
 
5
5
  ## 🦆 What It Does
6
6
 
@@ -10,7 +10,7 @@ Creates a group chat where you and multiple interactive Claude Code subagents ca
10
10
 
11
11
  ## 🦷 Features
12
12
 
13
- - **Multi-Terminal Launch** - Launch claude code subagents in new terminals
13
+ - **Multi-Terminal Launch** - Launch Claude Code subagents in new terminals
14
14
  - **Live Dashboard** - Real-time monitoring of all instances
15
15
  - **Multi-Agent Communication** - Claude instances talk to each other across projects
16
16
  - **@Mention Targeting** - Send messages to specific subagents or teams
@@ -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,18 +168,18 @@ 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
 
174
175
  - **Identity**: Each instance gets a unique name based on conversation UUID (e.g., "hovoa7")
175
176
  - **Persistence**: Names persist across `--resume` maintaining conversation context
176
177
  - **Status Detection**: Notification hook tracks permission requests and activity
177
- - **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). Agents can specify `model:` and `tools:` in YAML frontmatter
178
+ - **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). Agents can specify `model:` and `tools:` in YAML frontmatter
178
179
 
179
180
  ### Architecture
180
181
  - **Single conversation** - All instances share one global conversation
181
- - **Opt-in participation** - Only claude code instances launched with `hcom open` join the chat
182
+ - **Opt-in participation** - Only Claude Code instances launched with `hcom open` join the chat
182
183
  - **@-mention filtering** - Target messages to specific instances or teams
183
184
 
184
185
  ### File Structure
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hcom"
7
- version = "0.1.5"
8
- description = "Lightweight CLI tool for real-time messaging between Claude Code subagents using hooks"
7
+ version = "0.1.7"
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"
11
11
  license = {text = "MIT"}
@@ -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.7"
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
3
  hcom - Claude Hook Comms
4
- A lightweight multi-agent communication system for claude code
4
+ Lightweight CLI tool for real-time communication between Claude Code subagents using hooks
5
5
  """
6
6
 
7
7
  import os
@@ -170,27 +170,22 @@ def get_config_value(key, default=None):
170
170
  return config.get(key, default)
171
171
 
172
172
  def get_hook_command():
173
- """Determine the best hook command approach based on paths"""
173
+ """Get hook command with silent fallback
174
+
175
+ Uses ${HCOM:-true} for clean paths, conditional for paths with spaces.
176
+ Both approaches exit silently (code 0) when not launched via 'hcom open'.
177
+ """
174
178
  python_path = sys.executable
175
179
  script_path = os.path.abspath(__file__)
176
180
 
177
- # Characters that cause issues in shell expansion
178
- problematic_chars = [' ', '`', '"', "'", '\\', '\n', ';', '&', '|', '(', ')', ':',
179
- '$', '*', '?', '[', ']', '{', '}', '!', '~', '<', '>']
180
-
181
- has_problematic_chars = any(char in python_path or char in script_path
182
- for char in problematic_chars)
183
-
184
- if has_problematic_chars:
185
- # Use direct paths with proper escaping
186
- # Escape backslashes first, then quotes
187
- escaped_python = python_path.replace('\\', '\\\\').replace('"', '\\"')
188
- escaped_script = script_path.replace('\\', '\\\\').replace('"', '\\"')
189
- return f'"{escaped_python}" "{escaped_script}"', {}
181
+ if ' ' in python_path or ' ' in script_path:
182
+ # Paths with spaces: use conditional check
183
+ escaped_python = shlex.quote(python_path)
184
+ escaped_script = shlex.quote(script_path)
185
+ return f'[ "${{HCOM_ACTIVE}}" = "1" ] && {escaped_python} {escaped_script} || true', {}
190
186
  else:
191
- # Use single clean env var
192
- env_vars = {'HCOM': f'{python_path} {script_path}'}
193
- return '$HCOM', env_vars
187
+ # Clean paths: use environment variable
188
+ return '${HCOM:-true}', {}
194
189
 
195
190
  def build_claude_env():
196
191
  """Build environment variables for Claude instances"""
@@ -206,9 +201,11 @@ def build_claude_env():
206
201
 
207
202
  env.update(config.get('env_overrides', {}))
208
203
 
209
- # Add hook-specific env vars if using that approach
210
- _, hook_env_vars = get_hook_command()
211
- env.update(hook_env_vars)
204
+ # Set HCOM only for clean paths (spaces handled differently)
205
+ python_path = sys.executable
206
+ script_path = os.path.abspath(__file__)
207
+ if ' ' not in python_path and ' ' not in script_path:
208
+ env['HCOM'] = f'{python_path} {script_path}'
212
209
 
213
210
  return env
214
211
 
@@ -423,15 +420,22 @@ def _remove_hcom_hooks_from_settings(settings):
423
420
 
424
421
  # Patterns to match any hcom hook command
425
422
  # - $HCOM post/stop/notify
423
+ # - ${HCOM:-...} post/stop/notify
424
+ # - [ "${HCOM_ACTIVE}" = "1" ] && ... hcom.py ... || true
426
425
  # - hcom post/stop/notify
426
+ # - uvx hcom post/stop/notify
427
427
  # - /path/to/hcom.py post/stop/notify
428
+ # - sh -c "[ ... ] && ... hcom ..."
428
429
  # - "/path with spaces/python" "/path with spaces/hcom.py" post/stop/notify
429
430
  # - '/path/to/python' '/path/to/hcom.py' post/stop/notify
430
431
  hcom_patterns = [
431
- r'\$HCOM\s+(post|stop|notify)\b', # Environment variable
432
+ r'\$\{?HCOM', # Environment variable (with or without braces)
433
+ r'\bHCOM_ACTIVE.*hcom\.py', # Conditional with HCOM_ACTIVE check
432
434
  r'\bhcom\s+(post|stop|notify)\b', # Direct hcom command
435
+ r'\buvx\s+hcom\s+(post|stop|notify)\b', # uvx hcom command
433
436
  r'hcom\.py["\']?\s+(post|stop|notify)\b', # hcom.py with optional quote
434
437
  r'["\'][^"\']*hcom\.py["\']?\s+(post|stop|notify)\b', # Quoted path with hcom.py
438
+ r'sh\s+-c.*hcom', # Shell wrapper with hcom
435
439
  ]
436
440
  compiled_patterns = [re.compile(pattern) for pattern in hcom_patterns]
437
441
 
@@ -713,7 +717,7 @@ def setup_hooks():
713
717
  if hcom_send_permission not in settings['permissions']['allow']:
714
718
  settings['permissions']['allow'].append(hcom_send_permission)
715
719
 
716
- # Get the hook command approach (env vars or direct paths based on spaces)
720
+ # Get the hook command template
717
721
  hook_cmd_base, _ = get_hook_command()
718
722
 
719
723
  # Add PostToolUse hook
@@ -1280,18 +1284,21 @@ def cmd_help():
1280
1284
 
1281
1285
  Usage:
1282
1286
  hcom open [n] Launch n Claude instances
1287
+ hcom open <agent> Launch named agent from .claude/agents/
1283
1288
  hcom open --prefix name n Launch with name prefix
1284
1289
  hcom watch View conversation dashboard
1285
- hcom clear Clear and archive conversation
1286
- hcom cleanup Remove hooks from current directory
1287
- hcom cleanup --all Remove hooks from all tracked directories
1288
- hcom help Show this help
1290
+ hcom clear Clear and archive conversation
1291
+ hcom cleanup Remove hooks from current directory
1292
+ hcom cleanup --all Remove hooks from all tracked directories
1293
+ hcom help Show this help
1289
1294
 
1290
1295
  Automation:
1291
- hcom send 'msg' Send message
1292
- hcom send '@prefix msg' Send to specific instances
1293
- hcom watch --logs Show logs
1294
- hcom watch --status Show status""")
1296
+ hcom send 'msg' Send message
1297
+ hcom send '@prefix msg' Send to specific instances
1298
+ hcom watch --logs Show logs
1299
+ hcom watch --status Show status
1300
+
1301
+ Docs: https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/README.md""")
1295
1302
  return 0
1296
1303
 
1297
1304
  def cmd_open(*args):
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcom
3
- Version: 0.1.5
4
- Summary: Lightweight CLI tool for real-time messaging between Claude Code subagents using hooks
3
+ Version: 0.1.7
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
7
7
  Project-URL: Homepage, https://github.com/aannoo/claude-hook-comms
@@ -26,9 +26,9 @@ Classifier: Topic :: Communications
26
26
  Requires-Python: >=3.6
27
27
  Description-Content-Type: text/markdown
28
28
 
29
- # Claude Code Hook Comms
29
+ # hcom - Claude Hook Comms
30
30
 
31
- Lightweight CLI tool for real-time communication between claude code [subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents) using [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
31
+ Lightweight CLI tool for real-time communication between Claude Code [subagents](https://docs.anthropic.com/en/docs/claude-code/sub-agents) using [hooks](https://docs.anthropic.com/en/docs/claude-code/hooks).
32
32
 
33
33
  ## 🦆 What It Does
34
34
 
@@ -38,7 +38,7 @@ Creates a group chat where you and multiple interactive Claude Code subagents ca
38
38
 
39
39
  ## 🦷 Features
40
40
 
41
- - **Multi-Terminal Launch** - Launch claude code subagents in new terminals
41
+ - **Multi-Terminal Launch** - Launch Claude Code subagents in new terminals
42
42
  - **Live Dashboard** - Real-time monitoring of all instances
43
43
  - **Multi-Agent Communication** - Claude instances talk to each other across projects
44
44
  - **@Mention Targeting** - Send messages to specific subagents or teams
@@ -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,18 +196,18 @@ 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
 
202
203
  - **Identity**: Each instance gets a unique name based on conversation UUID (e.g., "hovoa7")
203
204
  - **Persistence**: Names persist across `--resume` maintaining conversation context
204
205
  - **Status Detection**: Notification hook tracks permission requests and activity
205
- - **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). Agents can specify `model:` and `tools:` in YAML frontmatter
206
+ - **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). Agents can specify `model:` and `tools:` in YAML frontmatter
206
207
 
207
208
  ### Architecture
208
209
  - **Single conversation** - All instances share one global conversation
209
- - **Opt-in participation** - Only claude code instances launched with `hcom open` join the chat
210
+ - **Opt-in participation** - Only Claude Code instances launched with `hcom open` join the chat
210
211
  - **@-mention filtering** - Target messages to specific instances or teams
211
212
 
212
213
  ### File Structure
File without changes
File without changes
File without changes