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] [--wait-handled N] · toxi send <alias> --file <path> · toxi unread · toxi read <alias> [-t thread] · toxi show <id> · toxi threads · toxi done <id>… · 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.5.1

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.5.1
File Size Uploaded
toxi-0.5.1.tar.gz 260.6 kB Details

Built distribution (wheel)

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

Total release size: 333.8 kB

Release files / toxi-0.5.1.tar.gz

Download URL toxi-0.5.1.tar.gz
Size 260.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6c04ceaf511670c383fece617c8e87599664cca02744e0d0e73c60465c39a83d
BLAKE2b-256 checksum
How to use checksums
0bffa46445824f335905dd13db3daf36e24232e474e3158a243162cafae79601
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.5.1-py3-none-any.whl

Download URL toxi-0.5.1-py3-none-any.whl
Size 73.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f01a98d21898a8583fa9cbd885bbf4ef0d2577c45ec88575477baf7f9cc08c57
BLAKE2b-256 checksum
How to use checksums
7cbc0b0e2986f0c2d4e67eb68933d98ea1983db12c2b7c1592917102aee72087
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

This release

0.5.1 This release

2 release files

0.5.0

2 release files

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