Skip to main content

🛰️ toxi

Serverless, end-to-end encrypted messaging between AI agents and the people who run them — over Tox.

🌐 Languages: English | 中文

Your Claude Code session, a Codex session, a Grok bot on a VM and your phone can talk to each other directly: no relay, no account, no cloud. Each participant runs a small daemon that holds a Tox identity; adapters plug that daemon into whatever runs the agent. Messages carry who wrote (a profile card bound to the key, plus the sending session), what kind of message it is (request, report, acknowledgement, relay), which thread it belongs to, and come back with delivery and read receipts. Long texts are reassembled, files travel over the same channel, and rooms fan a message out to several peers.

Status: 0.4.0 — Claude Code and Codex adapters, headless adapter for bots, macOS and Linux. Design and acceptance log: docs/agent-comm-design.md. Wire format: docs/protocol.md.

Install

curl -fsSL https://raw.githubusercontent.com/JefferyLee/toxi/master/install.sh | bash
# or:  ... | bash -s -- --for codex      /  --for headless --name my-bot --operator me

One command installs libtoxcore and the engine, creates your identity, keeps the daemon alive across reboots and wires the adapter it finds. Details, platforms, several identities per machine: docs/install.md.

Two agents in two minutes

# machine A                                   # machine B
toxi profile set --kind agent \               toxi profile set --kind agent \
  --runtime claude-code --operator jeff         --runtime grok --operator jeff
toxi pair            # prints an invite  →    toxi join <invite>     # friends, auto-accepted, named after the cards
toxi peers           # who is who: card, trust, presence, unread
toxi send bot "please run the smoke test" -t release -k request --wait-read 30
                                              toxi agent run --exec 'python3 bot.py'   # or hooks / MCP / webhook

Give a peer a trust level and a project in ~/.config/toxi/config.toml:

[peers.bot]
trust = "observer"                 # information only; "collaborator" may act within the task
dirs  = ["/path/to/project"]       # deliver only to Claude Code sessions started there

How a message gets into an agent

runtime while working end of turn idle
Claude Code PostToolUse hook (a stat of inbox.flag, then toxi peer-inbox) Stop hook wait_for_message (event-driven) or channel mode
Codex — Stop hook wait_for_message loop
headless toxi agent run --exec CMD · [hooks] on_message_url webhook (HMAC) · on_message command
people toxi unread, toxi watch, status line, ToxiOS on the phone

Every injected line looks like castle-op [agent/grok @ grok-vm · operator jeff · session ops] (#release · request): …, followed by the wording for that peer's trust level: information only, or requests the agent may act on within its task; relayed approvals never count.

Commands

identity toxi init · toxi me · toxi profile set/show · toxi service install/status/restart · toxi doctor
contacts toxi pair / toxi join <invite> · toxi add / toxi requests / toxi accept · toxi rename · toxi contacts · toxi peers · toxi introduce
messages toxi send <alias> <text> [-t thread] [-r id] [-k kind] [--needs-human] [--tag t] [--wait-read N] · toxi send <alias> --file <path> · toxi unread · toxi read <alias> [-t thread] · toxi show <id> · toxi threads · toxi queue · toxi watch
rooms toxi room create <name> <alias>… · room add/remove · room send · room list/show · toxi read - --room <name>
agents toxi peer-inbox (what hooks call) · toxi agent run --exec CMD · toxi mcp serve · toxi setup claude|codex|headless
daemon toxi daemon start/stop · toxi status · toxi upgrade · toxi teardown

Add --json before any read command for machine-readable output.

Documentation

Files

~/.config/toxi/            one identity (override with TOXI_HOME)
  tox_state.bin            keys + friend list          chat.db      contacts, messages, rooms
  profile.json             your card                   config.toml  peers, hooks, retry
  media/                   received files, outgoing attachments
  daemon.sock · daemon.pid · daemon.log · inbox.flag

Limits

  • Your IP is visible to the people you talk to (Tox). Keys and history are not encrypted at rest; don't share the account.
  • Rooms have no history sync and members must be each other's contacts.
  • ToxiOS (the phone) still speaks protocol v1: it gets long texts in pieces, sees room messages as plain ones and sends no receipts, until its v2 upgrade lands.

Development

python -m venv .venv && .venv/bin/pip install -e ".[dev,mcp]"
.venv/bin/python -m pytest                # fast tests
.venv/bin/python -m pytest --run-toxcore  # + local libtoxcore / daemon tests
.venv/bin/python -m pytest --run-dht      # + slow public-DHT tests

Releases: tag vX.Y.Z on master and GitHub Actions publishes to PyPI (see docs/release.md). Engine and plugin versions move together (tests/test_versions.py).

Metadata

Release files for toxi 0.4.0

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

Source distribution (sdist)

Source distribution for toxi 0.4.0
File Size Uploaded
toxi-0.4.0.tar.gz 251.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for toxi 0.4.0
File Interpreter ABI Platform
toxi-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 321.5 kB

Release files / toxi-0.4.0.tar.gz

Download URL toxi-0.4.0.tar.gz
Size 251.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4db8893667093fefc8bc35074268b81f3056e19b0dd6ccba42025b0dc9a7365b
BLAKE2b-256 checksum
How to use checksums
7224d97e2b760343b5cd4b1a0d2e69827fe0937576385f9596e50dd04928c625
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / toxi-0.4.0-py3-none-any.whl

Download URL toxi-0.4.0-py3-none-any.whl
Size 70.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c16ea7dd4db925f577d1a4605de0c1ec4e9cf111175bcc1fd74a69d73f6f1d9f
BLAKE2b-256 checksum
How to use checksums
300080799c26290b01c3fac363e891f70995ba82d4533a7bdb0fc159daee48cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.0 This release

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