Skip to main content

hcom

CI Latest release License: MIT

Hook your coding agents together

hcom is a CLI that agents can use to message, watch, and spawn each other across terminals. It integrates with Claude Code, Gemini, Codex, OpenCode, Kilo Code, Pi, Oh My Pi, Antigravity, Cursor, Kimi and Copilot without changing how you use them.

Use it to coordinate pipelines, run different AI CLIs as each other's subagents, or just instead of copy-paste.

Single Rust binary, no background services. Start an agent with hcom in front, then prompt normally.

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


Install

brew install aannoo/hcom/hcom
Other install options
# Shell installer for macOS, Linux, Android (Termux), and WSL
curl -fsSL https://github.com/aannoo/hcom/releases/latest/download/hcom-installer.sh | sh
# PowerShell installer for Windows
irm https://github.com/aannoo/hcom/releases/latest/download/hcom-installer.ps1 | iex
# With PyPI
uv tool install hcom  # or: pip install hcom
# Update any existing install to latest hcom version
hcom update

Quickstart

Terminal 1:

hcom claude   # codex / gemini / opencode / kilo / pi / omp / agy / cursor-agent / kimi / copilot

Terminal 2:

hcom codex

Prompt:

  • ask the other agent their favorite cake
  • review what claude did and send it fixes
  • spawn 3x gemini, split work, collect results
  • fork yourself to investigate the bug and report back

Open the TUI:

hcom

What agents can do

Message each other in real-time: intent, replies, bundled context for handoffs.

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

Subscribe to each other: notify on status changes, file edits, specific events. React automatically.

Spawn, fork, resume, kill each other, 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

Messages arrive mid-turn (injected between tool calls) or wake idle agents immediately.

Each agent gets a queryable identity:

  • name
  • status (active, blocked, listening)
  • inbox
  • live terminal screen
  • transcript in structured chunks
  • event log of every status change, file edit, tool call

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

Hooks go into config dirs under ~/ (or HCOM_DIR) on first run. If you aren't using hcom, the hooks do nothing.

Without hooks, any other AI tool 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

hcom hooks remove            # safely remove all hcom hooks
brew 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
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   # 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/vanilla 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 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.

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

# On native Windows (PowerShell)
just ci-windows

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hcom-0.7.24-py3-none-win_amd64.whl (6.4 MB view details)

Uploaded Python 3Windows x86-64

hcom-0.7.24-py3-none-musllinux_1_2_x86_64.whl (6.6 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

hcom-0.7.24-py3-none-musllinux_1_2_aarch64.whl (6.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

hcom-0.7.24-py3-none-manylinux_2_28_aarch64.whl (5.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

hcom-0.7.24-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

hcom-0.7.24-py3-none-macosx_11_0_arm64.whl (5.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

hcom-0.7.24-py3-none-macosx_10_12_x86_64.whl (6.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

hcom-0.7.24-py3-none-android_24_arm64_v8a.whl (6.0 MB view details)

Uploaded Android API level 24+ ARM64 v8aPython 3

File details

Details for the file hcom-0.7.24-py3-none-win_amd64.whl.

File metadata

  • Download URL: hcom-0.7.24-py3-none-win_amd64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hcom-0.7.24-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d6c26125c22a3e9d615c5cfdc64f0e00050e7d5266e0a8d90fb7692a285e571d
MD5 93df0e37171fd4c2e962c3700ea09f9a
BLAKE2b-256 8117d25b1a4b928a758f2fc7d1d808c8123e282f6784b3370f2bf9417c637666

See more details on using hashes here.

File details

Details for the file hcom-0.7.24-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for hcom-0.7.24-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c0d9b0c768ec2a247447a6d143fa005590f941e9a1f25cbb0a060b0cf8ff4656
MD5 12dd436ce481a635d2e4448e1eb95fdd
BLAKE2b-256 50739328b71eaf9ab0f9e44947eb8150ededf7024e9fe9462e44535bde48827c

See more details on using hashes here.

File details

Details for the file hcom-0.7.24-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for hcom-0.7.24-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 07fbfde510a6ced0e32bf33b7ca1ed406f8e5862038355b1eb22efc08e10e694
MD5 bd72994d42ce03d110bc7a3be693a17a
BLAKE2b-256 88768eeddf0b238b8d4d01cc8843cd78d20f77c1160576a96186aab64583079e

See more details on using hashes here.

File details

Details for the file hcom-0.7.24-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for hcom-0.7.24-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 36a969c2fa87e456ba33c4e1401b50330632db3505f6c09b8e1737d3ef5f8287
MD5 ee758cc31e1c824ee05f81a8c6a35ea4
BLAKE2b-256 c9f4900d18a85a2f7a49a2da8101f3f9b2a8c2cf7833d836e8937807f2d8209a

See more details on using hashes here.

File details

Details for the file hcom-0.7.24-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hcom-0.7.24-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c86c9c58ef8b6302e25d48627cc8c2e496898de79c427f309e10790b48913d48
MD5 700b8a8a26cea19c1f7f60f309d1e70f
BLAKE2b-256 952a7be8e4bc8f935ff2a20c0e2a01e863bf5bd0717353d890adb43eff38429d

See more details on using hashes here.

File details

Details for the file hcom-0.7.24-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: hcom-0.7.24-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 5.8 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hcom-0.7.24-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44a2a96d61549787169a8ed457bff8b29ad1ceecedf10c81e1abf71e78031440
MD5 2038b152eb193e52f5754c7b2638c218
BLAKE2b-256 45691b729ebebe2c0d404015817bad0bca25573fb347b1ea7d1c0d14a5d9c41d

See more details on using hashes here.

File details

Details for the file hcom-0.7.24-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for hcom-0.7.24-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 009a8f76683610168d2a763802bb8e728698e8f1376f4d0c76d8acf691f71b2f
MD5 3db46c2751c636717b10b42a283d8f44
BLAKE2b-256 b8aeb94198e5f317fb3a5ba3fd244f565b2198a223d143b158fbf07b59ef8bf2

See more details on using hashes here.

File details

Details for the file hcom-0.7.24-py3-none-android_24_arm64_v8a.whl.

File metadata

  • Download URL: hcom-0.7.24-py3-none-android_24_arm64_v8a.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: Android API level 24+ ARM64 v8a, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hcom-0.7.24-py3-none-android_24_arm64_v8a.whl
Algorithm Hash digest
SHA256 c67e259c6587d7c54c0ec1f0f1721a4fd5324ff3618c094c024fe3806f29fc6c
MD5 40bfe798b999a3bcd5c803607bb5fdc9
BLAKE2b-256 f70a2a45f6912e4849dab4f28cdb22401fd47854ddc07bb2c94f4cb6ce71bdc4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page