Skip to main content

hcom

CI Latest release License: MIT

Hook your coding agents together

hcom is a CLI that agents use to message, watch, and spawn each other across terminals.

Start an agent with hcom in front, then prompt normally.

Use it to:

  • coordinate multi-agent pipelines
  • run different AI CLIs as each other's subagents
  • avoid copy-pasting

Works with: claude, codex, opencode, pi, omp, agy, cursor, kimi, kilo, copilot, gemini

https://github.com/user-attachments/assets/1ce23ed9-f529-4be0-8124-816aa4c2fd43


Install

python - macOS, Linux, Windows:

uv tool install hcom

homebrew - macOS, Linux:

brew install aannoo/hcom/hcom
Other install options
# macOS, Linux, Android
curl -fsSL https://github.com/aannoo/hcom/releases/latest/download/hcom-installer.sh | sh
# Windows
irm https://github.com/aannoo/hcom/releases/latest/download/hcom-installer.ps1 | iex
# Update any existing install
hcom update

Quickstart

Terminal 1:

hcom claude

Terminal 2:

hcom codex

Prompt:

  • ask the other agent their favorite cake
  • review what claude did and send it fixes
  • spawn 3x opencode, split work, collect results
  • fork yourself to investigate the bug and report back
  • when codex goes idle, send it the next task

Open the TUI dashboard:

hcom

What agents can do

Message each other in real time: mid-turn or wake immediately when idle

Observe each other: status, transcripts, file edits, live terminal screens, command history.

Subscribe and notify on status changes, file edits, collisions, specific events. React automatically.

Spawn, fork, resume, kill in any terminal emulator or headless.


How it works

Hooks record activity to a local SQLite database and deliver messages from it.

agent → hooks → db → hooks → other agent

Hooks activate only when an agent is launched with hcom in front. Normal usage is unaffected.

Any other AI tool without hooks can join by running hcom start. Any process can wake agents with hcom send.


Terminal

Every 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.

To configure a custom terminal open/close setup, tell an agent to run:

hcom config terminal --info

Cross-device

Connect agents across machines via MQTT relay.

hcom relay new               # get token
hcom relay connect <token>   # on each device
hcom relay status            # check connection
hcom relay off|on            # toggle
Relay Security

Security

  • Relay payloads are end-to-end encrypted. Brokers do not see data.
  • Treat the join token like an SSH key or API key.
  • If the token may have leaked, run hcom relay off --all to disconnect all devices.
  • Use a private/custom/self-hosted broker with --broker and --password for better security.

Security model

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.

Relay 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.

Brokers and network observers cannot read or forge payloads without the PSK. They can still see metadata: topic names, timing, message sizes, and connection patterns.

What the token means

The 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.

On 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.

On 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.

Limits by design

  • Forward secrecy. A leaked PSK can decrypt old captured traffic.
  • Per-device attribution inside a relay. Sender identity is routing metadata, not authorization. Every enrolled device speaks with full authority.
  • 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.
  • 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.

Storage

The PSK is stored in ~/.hcom/config.toml. On Unix, hcom writes that file with mode 0600.

hcom 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.

Anyone who can read that file — another user on the same OS account, malware, or a backup written without preserving permissions — has the full PSK.

Incident response

Run 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.

The 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.

To 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.


Troubleshoot

hcom status                  # diagnostics
hcom reset all               # clear and archive: database + hooks + config

Uninstall

Safely remove all hcom hooks:

hcom hooks remove

Then remove binary:

brew uninstall hcom
# or: uv tool uninstall hcom
# or: rm "$(which hcom)"

Reference

Tools

Supported tools

Tool Message delivery Connect
Claude Code automatic hcom claude
Gemini CLI automatic hcom gemini
Codex CLI automatic hcom codex
Antigravity CLI automatic hcom agy
OpenCode automatic hcom opencode
Kilo Code automatic hcom kilo
Pi automatic hcom pi
Oh My Pi automatic hcom omp
Cursor CLI automatic hcom cursor-agent
Kimi automatic hcom kimi
Copilot CLI automatic hcom copilot
Grok Build automatic hcom grok
Anything else manual via hcom listen hcom start (run inside tool)
hcom r <session_id>           # Resume a session started outside hcom
hcom f <session_id>           # Fork a session in hcom

Claude Code headless and subagents

Detached background processes in print mode stay alive. Manage through the TUI.

hcom claude -p 'say hi in hcom'   # print mode (separate Agent SDK credits)
hcom claude --headless            # Run normal claude in background pty (works for any tool)

For subagents, run hcom claude, then prompt:

run 2x task tool and get them to talk to each other in hcom

CLI

CLI commands

What 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.

Spawn

hcom [N] claude|gemini|codex|agy|opencode|kilo|pi|omp|cursor-agent|kimi|copilot|grok   # launch N agents
hcom r <name|session_id>     # resume agent
hcom f <name|session_id>     # fork session
hcom kill <name|tag:T|all>   # kill + close terminal pane

hcom launch flags:

Flag Purpose
--tag <name> Group label — agents can be addressed as @tag
--terminal <preset> Where windows open: default (auto-detect), kitty, wezterm, tmux, cmux, iterm, etc…
--dir <path> Directory where the agent launches
--headless Run in background pty with no terminal window
--device <name> Spawn on a remote device (via relay)
--hcom-prompt <text> Initial user prompt
--hcom-system-prompt <text> Append to system prompt

Anything else is forwarded to the tool: --model sonnet, --yolo, etc.

Other commands

hcom                           # TUI dashboard
hcom send -b @luna -- hey      # one-off message to an agent
hcom list                      # show all active agents
hcom term [name]               # view/inject into an agent's PTY screen
hcom events --wait <filters>   # Block until match for scripting
hcom update                    # update hcom version

hcom run docs --cli for all commands.

Config

Configuration

Config lives in ~/.hcom/config.toml. Precedence: defaults < config.toml < env vars.

hcom config                           # show all values with sources
hcom config <key>                     # get
hcom config <key> <value>             # set
hcom config <key> --info              # detailed help for a key
hcom config -i <name> <key> <value>   # per-agent override at runtime

Keys

Key Purpose
tag Group label — launched agents become tag-name
hints Text appended to every message the agent receives
notes Text appended to bootstrap (one-time, at launch)
auto_approve Auto-approve safe hcom commands (send/list/events/…)
auto_subscribe Event subscription presets: collision, created, stopped, blocked
name_export Export instance name to a custom env var
title_mode Terminal/tab title behavior: combined (default), label, or off
terminal Where new agent windows open (hcom config terminal --info)
timeout Idle timeout for headless Claude (seconds)
subagent_timeout Keep-alive for Claude subagents (seconds)
claude_args / gemini_args / codex_args / opencode_args / kilo_args / pi_args / omp_args / cursor_args / kimi_args / copilot_args / grok_args Default args passed to the tool

Scope

hcom config tag mycrew                        # global
hcom config -i luna hints "respond in JSON"   # per-agent
HCOM_TAG=dev hcom 3 claude                    # per-launch env

Per-project isolation

export HCOM_DIR="$PWD/.hcom"    # isolate state + hooks to this folder
hcom hooks remove && rm -rf "$HCOM_DIR"

Run hcom config <key> --info or hcom run docs --config for the full per-key reference.

Edit ~/.hcom/env to set external env vars passed to every launched agent.

Workflow Scripts

Multi-agent workflows

Bundled and user scripts (~/.hcom/scripts/) for multi-agent patterns:

hcom run                   # list available scripts
hcom run debate "topic"    # run one
hcom run docs              # tell agent to run this to create any new workflow

Included scripts

Tell agent to run them:

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.

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.

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.

hcom run onidle — waits for an agent to go idle, then types text into another agent (hcom run onidle luna nova 'luna is done, review it') or launches a new one with it as the prompt (hcom run onidle luna codex 'review what luna just did').

Custom 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.

Build

Building from source

# Prerequisites: Rust 1.88+

git clone https://github.com/aannoo/hcom.git
cd hcom
cargo build
cargo test

Using local build

Two options:

Symlink — simple, dev build is global.

ln -sf $(pwd)/target/debug/hcom ~/.cargo/bin/hcom

dev_root — works regardless of how hcom was installed (brew, pip, etc.); picks the newer of debug/release automatically:

hcom config dev_root $(pwd)
hcom config dev_root --unset  # revert
hcom status    # run local build

For concurrent worktrees, scope each to its own DB:

HCOM_DIR=$PWD/.hcom HCOM_DEV_ROOT=$PWD hcom claude

Contributing

Issues and PRs welcome. The codebase is Rust.

cargo build && cargo test
hcom config dev_root $(pwd)
hcom status
just ci  # run the CI gate locally

License

MIT

Metadata

Release files for hcom 0.7.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for hcom 0.7.27
File
hcom-0.7.27-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
hcom-0.7.27-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details
hcom-0.7.27-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details
hcom-0.7.27-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
hcom-0.7.27-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
hcom-0.7.27-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
hcom-0.7.27-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details
hcom-0.7.27-py3-none-android_24_arm64_v8a.whl Python 3 none Android API level 24+ ARM64 v8a Details

Total release size: 51.5 MB

Release files / hcom-0.7.27-py3-none-win_amd64.whl

Download URL hcom-0.7.27-py3-none-win_amd64.whl
Size 6.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
2ca179c206e43e81b048e2da0b7da80e34cdc8ad1263579e498e21b5139b000a
BLAKE2b-256 checksum
How to use checksums
b598c7df8b2391ffac775be0471e9aa39542cd5a2f1b80ca762e3eaaf9a85e4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / hcom-0.7.27-py3-none-musllinux_1_2_x86_64.whl

Download URL hcom-0.7.27-py3-none-musllinux_1_2_x86_64.whl
Size 6.8 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1deaa786e133fd22a6a252b0432c480eae8fc7083517cb114907ffdf9d1d0029
BLAKE2b-256 checksum
How to use checksums
a0ce7d1d7ce0cf10006de25bee141fc097a19f92e317511ddd07f8afa284708c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / hcom-0.7.27-py3-none-musllinux_1_2_aarch64.whl

Download URL hcom-0.7.27-py3-none-musllinux_1_2_aarch64.whl
Size 6.3 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
0a4fd6f2715027f37af6448f641ab5cc3d79c0cf1ac894ff9ec24a74b5e6f523
BLAKE2b-256 checksum
How to use checksums
abd4480fa97b817b3268ded5ce8c989474e27de583f42aa65bb8b610b90f9776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / hcom-0.7.27-py3-none-manylinux_2_28_aarch64.whl

Download URL hcom-0.7.27-py3-none-manylinux_2_28_aarch64.whl
Size 6.1 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
0918890d5887701e98e1b9a55a5d8ac21fcca5473266327523f60ece64bc4fe6
BLAKE2b-256 checksum
How to use checksums
39d570494077957aeab6a7564d203b586c01fb1e24219f6a18f5e1989dbbf6b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / hcom-0.7.27-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hcom-0.7.27-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.7 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b8e36fa6f89b1aabc0dcdf08bfc246ff6a8442851679cf8b603de81125e29ef5
BLAKE2b-256 checksum
How to use checksums
10dca1f7f4fd0d334e008d37aef4f9dc1caa1a378a0e10f36f7fed4055e0965a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / hcom-0.7.27-py3-none-macosx_11_0_arm64.whl

Download URL hcom-0.7.27-py3-none-macosx_11_0_arm64.whl
Size 6.1 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
12de1a33aa766c14b4a1fcfcf75f51567ffef0c0f581504184418af802388821
BLAKE2b-256 checksum
How to use checksums
b33c863f3a6076b9e4cda4e6d83063d9ba0f19865aedd74356516e7e86ee06b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / hcom-0.7.27-py3-none-macosx_10_12_x86_64.whl

Download URL hcom-0.7.27-py3-none-macosx_10_12_x86_64.whl
Size 6.6 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a2dafcd0572c06862440fd836079e71a9f43051d0fcdfca20484206fcbc1f909
BLAKE2b-256 checksum
How to use checksums
404e65db616389ffe628eb5a42a80fff57831f44be7f5e9069e744dc632732cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / hcom-0.7.27-py3-none-android_24_arm64_v8a.whl

Download URL hcom-0.7.27-py3-none-android_24_arm64_v8a.whl
Size 6.3 MB
Tags Android API level 24+ ARM64 v8a Python 3
SHA-256 checksum
How to use checksums
53114d6cc3f9fa03eebb1b4b0cc1dc50160b1bad7d6825725ca7fd72955379f4
BLAKE2b-256 checksum
How to use checksums
9c0bf79033bb70bbcbb7b3d9e6ece309150b89d1b2a098c61cb10fd0f61974f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release history Release notifications | RSS feed

0.7.30

8 release files

0.7.29

8 release files

This release

0.7.27 This release

8 release files

0.7.26

8 release files

0.7.24

8 release files

0.7.22

6 release files

0.7.19

6 release files

0.7.18

6 release files

0.7.17

6 release files

0.7.13

6 release files

0.7.12

6 release files

0.7.11

6 release files

0.7.9

6 release files

0.7.8

6 release files

0.7.7

6 release files

0.7.6

6 release files

0.7.5

6 release files

0.7.4

6 release files

0.7.3

6 release files

0.7.2

6 release files

0.7.1

6 release files

0.7.0

6 release files

0.6.22

6 release files

0.6.21

6 release files

0.6.20

6 release files

0.6.19

4 release files

0.6.18

4 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

1 release file

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page