{
  "markdown": "# hcom\n\n[![CI](https://github.com/aannoo/hcom/actions/workflows/ci.yml/badge.svg)](https://github.com/aannoo/hcom/actions/workflows/ci.yml)\n[![Latest release](https://img.shields.io/github/v/release/aannoo/hcom)](https://github.com/aannoo/hcom/releases)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/aannoo/hcom/blob/main/LICENSE)\n\n> **Hook your coding agents together**\n\n`hcom` is a CLI that coding agents use to message, watch, and spawn each other across terminals. It integrates with Claude Code, Codex, OpenCode, Kilo Code, Pi, Oh My Pi, Antigravity, Cursor, Kimi, Gemini and Copilot - in any combination, without changing how you use them.\n\nUse it to coordinate pipelines, run different AI CLIs as each other's subagents, or just instead of copy-paste.\n\nSingle Rust binary, no background services. Start an agent with `hcom` in front, then prompt normally.\n\nhttps://github.com/user-attachments/assets/1ce23ed9-f529-4be0-8124-816aa4c2fd43\n\n---\n\n## Install\n\n```bash\nbrew install aannoo/hcom/hcom\n```\n\n<details><summary>Other install options</summary>\n\n```bash\n# With Python\nuv tool install hcom  # or: pip install hcom\n```\n\n```bash\n# macOS, Linux, Android (Termux), and WSL\ncurl -fsSL https://github.com/aannoo/hcom/releases/latest/download/hcom-installer.sh | sh\n```\n\n```powershell\n# Windows (native, Powershell)\nirm https://github.com/aannoo/hcom/releases/latest/download/hcom-installer.ps1 | iex\n```\n\n```bash\n# Update any existing install to latest hcom version\nhcom update\n```\n\n</details>\n\n---\n\n## Quickstart\n\nTerminal 1:\n\n```bash\nhcom claude   # codex / opencode / kilo / pi / omp / agy / cursor-agent / kimi / copilot / gemini\n```\n\nTerminal 2:\n\n```bash\nhcom codex\n```\n\nPrompt:\n\n- `ask the other agent their favorite cake`\n- `review what claude did and send it fixes`\n- `spawn 3x opencode, split work, collect results`\n- `fork yourself to investigate the bug and report back`\n- `when codex goes idle, send it the next task`\n\nOpen the TUI dashboard:\n\n```bash\nhcom\n```\n\n---\n\n## What agents can do\n\n**Message** each other in real-time: intent, replies, threads, bundled context for handoffs.\n\n**Observe** each other: transcripts, file edits, terminal screens, command history.\n\n**Subscribe** to each other: notify on status changes, file edits, specific events. React automatically.\n\n**Spawn**, **fork**, **resume**, **kill** each other, in any terminal emulator or headless.\n\n---\n\n## How it works\n\nHooks record activity to a local SQLite database and deliver messages from it.\n\n```bash\nagent → hooks → db → hooks → other agent\n```\n\nMessages arrive mid-turn (injected between tool calls) or wake idle agents immediately.\n\nEach agent gets a queryable identity:\n\n- name\n- status\n- inbox\n- live terminal screen\n- transcript in structured chunks\n- event log of every file edit, tool call, etc\n\nAgents can subscribe to events and react instantly. Collision detection is on by default: if two agents edit the same file within 30 seconds, both get notified.\n\nHooks go into config dirs under `~/` (or `HCOM_DIR`) on first run. If you aren't using hcom, the hooks do nothing.\n\nAny other AI tool without hooks can join by running `hcom start`. Any process can wake agents with `hcom send`.\n\n---\n\n## Terminal\n\nEvery agent runs in a real terminal you can see, scroll, and interrupt. Any emulator works for spawning. **kitty**, **wezterm**, **tmux**, **zellij**, **waveterm**, **cmux**, **herdr** also support closing panes from `hcom kill`.\n\nTo configure a custom terminal open/close setup, tell an agent to run:\n\n```bash\nhcom config terminal --info\n```\n\n---\n\n## Cross-device\n\nConnect agents across machines via MQTT relay.\n\n```bash\nhcom relay new               # get token\nhcom relay connect <token>   # on each device\n```\n\n```bash\nhcom relay status            # check connection\nhcom relay off|on            # toggle\n```\n\n<details>\n<summary>Relay Security</summary>\n\n### Security\n\n- Relay payloads are end-to-end encrypted. Brokers do not see data.\n- Treat the join token like an SSH key or API key.\n- If the token may have leaked, run `hcom relay off --all` to disconnect all devices.\n- Use a private/custom/self-hosted broker with `--broker` and `--password` for better security.\n\n### Security model\n\n`hcom relay` is one trust domain for one operator's devices. Membership is all-or-nothing. There are no scoped roles, read-only peers, or per-device permissions.\n\nRelay payloads use a shared PSK with XChaCha20-Poly1305. The encryption binds each payload to the relay, topic, and timestamp. A replay guard drops duplicate envelopes inside a freshness window.\n\nBrokers and network observers cannot read or forge payloads without the PSK. They can still see metadata: topic names, timing, message sizes, and connection patterns.\n\n### What the token means\n\nThe join token contains the relay ID, broker URL, and raw PSK. hcom does not ask a server to validate it. It has no expiry, no scope, and no revocation list.\n\nOn public brokers, a leaked token gives an attacker full control of the relay. They can decrypt captured traffic, publish authenticated relay traffic, send text to listening agents, launch agents on enrolled devices, kill running agents, and use remote relay RPCs. If those agents can run tools, treat that as shell access on every enrolled device in the relay.\n\nOn private brokers with `--password`, the token still leaks the PSK, so captured traffic is still exposed. But the token alone is not enough to publish unless the attacker also has the broker password. Use a private broker when broker-side access control matters, or when the metadata shape of your traffic is itself sensitive. `--password` is broker access control, not another layer of message encryption.\n\n### Limits by design\n\n- Forward secrecy. A leaked PSK can decrypt old captured traffic.\n- Per-device attribution inside a relay. Sender identity is routing metadata, not authorization. Every enrolled device speaks with full authority.\n- Prompt injection from an authenticated peer. Enrollment is total trust — a peer can launch, kill, and drive agents via RPC, not just send messages. Only enroll devices you would give shell access to.\n- Local OS compromise. hcom trusts the local user account and `~/.hcom/config.toml`. It does not defend against another user on the same account or malware with filesystem access.\n\n### Storage\n\nThe PSK is stored in `~/.hcom/config.toml`. On Unix, hcom writes that file with mode `0600`.\n\nhcom keeps the PSK out of environment variables. Remote `config_get` and `config_set` refuse `relay_psk`, `relay_token`, `relay_id`, and the broker URL. `hcom relay status` shows only a short fingerprint so two devices can verify they share the same key without printing it.\n\nAnyone who can read that file — another user on the same OS account, malware, or a backup written without preserving permissions — has the full PSK.\n\n### Incident response\n\nRun `hcom relay off --all`. It asks every reachable trusted peer to disable the relay, then disables it locally, so your agents stop acting on attacker messages. It is best-effort damage control, not containment: the attacker's device ignores the request.\n\nThe PSK cannot be revoked. There is no server to notify and no denylist to update. Anyone who has the PSK can keep using the old relay until you stop using it.\n\nTo keep using relay after a leak, create a new relay with `hcom relay new` and move every trusted device to the new token. Rotation also changes the `relay_id`, so retained state on the old broker topics is orphaned.\n\n</details>\n\n---\n\n## Troubleshoot\n\n```bash\nhcom status                  # diagnostics\nhcom reset all               # clear and archive: database + hooks + config\n```\n\n---\n\n## Uninstall\n\n```bash\nhcom hooks remove            # safely remove all hcom hooks\nbrew uninstall hcom          # or: rm $(which hcom)\n```\n\n---\n\n## Reference\n\n<details>\n<summary>Tools</summary>\n\n### Supported tools\n\n| Tool | Message delivery | Connect |\n|---|---|---|\n| Claude Code | automatic | `hcom claude` |\n| Gemini CLI | automatic | `hcom gemini` |\n| Codex CLI | automatic | `hcom codex` |\n| Antigravity CLI | automatic | `hcom agy` |\n| OpenCode | automatic | `hcom opencode` |\n| Kilo Code | automatic | `hcom kilo` |\n| Pi | automatic | `hcom pi` |\n| Oh My Pi | automatic | `hcom omp` |\n| Cursor CLI | automatic | `hcom cursor-agent` |\n| Kimi | automatic | `hcom kimi` |\n| Copilot CLI | automatic | `hcom copilot` |\n| Anything else | manual via `hcom listen` | `hcom start` (run inside tool) |\n\n```bash\nhcom r <session_id>           # Resume a session started outside hcom\nhcom f <session_id>           # Fork a session in hcom\n```\n\n#### Claude Code headless and subagents\n\nDetached background processes in print mode stay alive. Manage through the TUI.\n\n```bash\nhcom claude -p 'say hi in hcom'   # print mode (separate Agent SDK credits)\nhcom claude --headless            # Run normal claude in background pty (works for any tool)\n```\n\nFor subagents, run `hcom claude`, then prompt:\n\n> run 2x task tool and get them to talk to each other in hcom\n\n</details>\n\n\n<details>\n<summary>CLI</summary>\n\n### CLI commands\n\nWhat you might type from a shell. Agents run their own commands that they learn from the hcom CLI primer (~700 tokens) at launch. `hcom <command> --help` for full flags.\n\n### Spawn\n\n```bash\nhcom [N] claude|gemini|codex|agy|opencode|kilo|pi|omp|cursor-agent|kimi|copilot   # launch N agents\nhcom r <name|session_id>                # resume agent\nhcom f <name|session_id>                # fork session\nhcom kill <name|tag:T|all>              # kill + close terminal pane\n```\n\nhcom launch flags:\n\n| Flag | Purpose |\n|---|---|\n| `--tag <name>` | Group label — agents can be addressed as `@tag` |\n| `--terminal <preset>` | Where windows open: `default` (auto-detect), `kitty`, `wezterm`, `tmux`, `cmux`, `iterm`, etc… |\n| `--dir <path>` | Directory where the agent launches |\n| `--headless` | Run in background pty with no terminal window |\n| `--device <name>` | Spawn on a remote device (via relay) |\n| `--hcom-prompt <text>` | Initial user prompt |\n| `--hcom-system-prompt <text>` | Append to system prompt |\n\nAnything else is forwarded to the tool: `--model sonnet`, `--yolo`, etc.\n\n### Other commands\n\n```bash\nhcom                                # TUI dashboard\nhcom send -b @luna -- hey           # one-off message to an agent\nhcom list                           # show all active agents\nhcom term [name]                    # view/inject into an agent's PTY screen\nhcom events --wait <filters>         # Block until match for scripting\nhcom update                         # update hcom version\n```\n\n`hcom run docs --cli` for all commands.\n\n</details>\n\n<details>\n<summary>Config</summary>\n\n### Configuration\n\nConfig lives in `~/.hcom/config.toml`. Precedence: defaults < `config.toml` < env vars.\n\n```bash\nhcom config                           # show all values with sources\nhcom config <key>                     # get\nhcom config <key> <value>             # set\nhcom config <key> --info              # detailed help for a key\nhcom config -i <name> <key> <value>   # per-agent override at runtime\n```\n\n### Keys\n\n| Key | Purpose |\n|---|---|\n| `tag` | Group label — launched agents become `tag-name` |\n| `hints` | Text appended to every message the agent receives |\n| `notes` | Text appended to bootstrap (one-time, at launch) |\n| `auto_approve` | Auto-approve safe hcom commands (send/list/events/…) |\n| `auto_subscribe` | Event subscription presets: `collision`, `created`, `stopped`, `blocked` |\n| `name_export` | Export instance name to a custom env var |\n| `title_mode` | Terminal/tab title behavior: `combined` (default), `label`, or `off` |\n| `terminal` | Where new agent windows open (`hcom config terminal --info`) |\n| `timeout` | Idle timeout for headless/vanilla Claude (seconds) |\n| `subagent_timeout` | Keep-alive for Claude subagents (seconds) |\n| `claude_args` / `gemini_args` / `codex_args` / `opencode_args` / `kilo_args` / `pi_args` / `omp_args` / `cursor_args` / `kimi_args` / `copilot_args` | Default args passed to the tool |\n\n### Scope\n\n```bash\nhcom config tag mycrew                          # global\nhcom config -i luna hints \"respond in JSON\"     # per-agent\nHCOM_TAG=dev hcom 3 claude                      # per-launch env\n```\n\n### Per-project isolation\n\n```bash\nexport HCOM_DIR=\"$PWD/.hcom\"    # isolate state + hooks to this folder\nhcom hooks remove && rm -rf \"$HCOM_DIR\"\n```\n\nRun `hcom config <key> --info` or `hcom run docs --config` for the full per-key reference.\n\nEdit `~/.hcom/env` to set external env vars passed to every launched agent.\n\n</details>\n\n<details>\n<summary>Workflow Scripts</summary>\n\n### Multi-agent workflows\n\nBundled and user scripts (`~/.hcom/scripts/`) for multi-agent patterns:\n\n```bash\nhcom run                   # list available scripts\nhcom run debate \"topic\"    # run one\nhcom run docs              # tell agent to run this to create any new workflow\n```\n\n### Included Scripts\n\nTell agent to run them:\n\n**`hcom run confess`** — An agent (or background clone) writes an honesty self-eval. A spawned calibrator reads the target's transcript independently. A judge compares both reports and sends back a verdict via hcom message.\n\n**`hcom run debate`** — A judge spawns and sets up a debate with existing agents. It coordinates rounds in a shared thread where all agents see each other's arguments, with shared context of workspace files and transcripts.\n\n**`hcom run fatcow`** — headless agent reads every file in a path, subscribes to file edit events to stay current, and answers other agents on demand.\n\nCustom scripts: drop `*.sh` or `*.py` into `~/.hcom/scripts/` — auto-discovered, override bundled scripts of the same name. Ask an agent to author one; `hcom run docs --scripts` is the authoring guide.\n\n</details>\n\n<details>\n<summary>Build</summary>\n\n### Building from Source\n\n```bash\n# Prerequisites: Rust 1.88+\n\ngit clone https://github.com/aannoo/hcom.git\ncd hcom\ncargo build\ncargo test\n```\n\n### Using local build\n\nTwo options:\n\n**Symlink** — simple, dev build is global.\n\n```bash\nln -sf $(pwd)/target/debug/hcom ~/.cargo/bin/hcom\n```\n\n**dev_root** — works regardless of how hcom was installed (brew, pip, etc.); picks the newer of debug/release automatically:\n\n```bash\nhcom config dev_root $(pwd)\nhcom config dev_root --unset  # revert\nhcom status    # run local build\n```\n\nFor concurrent worktrees, scope each to its own DB:\n\n```bash\nHCOM_DIR=$PWD/.hcom HCOM_DEV_ROOT=$PWD hcom claude\n```\n\n</details>\n\n\n---\n\n## Contributing\n\nIssues and PRs welcome. The codebase is Rust.\n\n```bash\ncargo build && cargo test\nhcom config dev_root $(pwd)\nhcom status\njust     # list the available recipes\njust ci  # run the CI gate locally (`just ci <step>` runs one step)\n```\n\n---\n\n## License\n\n[MIT](LICENSE)\n",
  "bytes": 14780,
  "sha": "3b97bec8de6d13eadaf35c0465058396b45f14e3693a51b3c74d650d2aab735f",
  "repo_slug": "aannoo/hcom",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_aannoo_hcom_910fce7c/readme"
}