Skip to main content

🛰️ toxi

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

🌐 Languages: English | 中文

Your Claude Code session, a Codex session, a Grok bot on a VM and your phone can send messages directly to each other. There is no relay, no account and no cloud. Each participant runs a small daemon that holds a Tox identity. An adapter connects the daemon to the program that runs the agent.

Each message carries this information:

  • Who wrote it: a profile card bound to the key, plus the sending session.
  • What kind of message it is: request, report, acknowledgement or relay.
  • Which thread it belongs to.

The sender gets delivery and read receipts back. toxi reassembles long texts. Files travel over the same channel. A room sends one message to several peers.

Status: 0.6.4. This release has Claude Code and Codex adapters and a headless adapter for bots. It runs on macOS and Linux. The design and acceptance log is in docs/agent-comm-design.md. The wire format is in docs/protocol.md.

Install

toxi is on PyPI: pypi.org/project/toxi.

brew install toxcore                         # Debian/Ubuntu: sudo apt install libtoxcore2
pipx install 'toxi[mcp]'                     # or: uv tool install 'toxi[mcp]'
toxi setup engine && toxi service install    # identity + daemon, kept alive across reboots
toxi setup claude                            # or: toxi setup codex · toxi setup headless --name my-bot --operator me

To upgrade, run pipx upgrade toxi. Then run toxi service restart.

The one-line installer does the same steps with the same PyPI package. It also does these steps:

  • It installs libtoxcore and pipx if they are missing.
  • It deploys the Claude Code plugin.
  • It runs toxi doctor at the end.

For a description of each step, see what it does, step by step.

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

For details, platforms and several identities on one machine, see 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

To give a peer a trust level and a project, edit ~/.config/toxi/config.toml:

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

How a message gets into an agent

runtime while the agent works end of turn while the agent is 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 PostToolUse hook: the same inbox.flag check 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, the status line, ToxiOS on the phone

Each injected line has this format: castle-op [agent/grok @ grok-vm · operator jeff · session ops] (#release · request): …. After the line comes the guide for the trust level of that peer. The guide says that the messages are information only, or that they are requests the agent can act on within its task. A relayed approval never counts.

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 (a new member gets the last 20 messages) · room send · room list/show · toxi read - --room <name>
history toxi search <text> · toxi archive --status · toxi archive --older-than 90d (or set [archive] after_days and the daemon archives each day)
agents toxi peer-inbox (the hooks call this command) · toxi agent run --exec CMD · toxi mcp serve · toxi setup claude|codex|headless
daemon toxi daemon start/stop · toxi status · toxi upgrade · toxi teardown

For machine-readable output, add --json before any read command.

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

  • The people you talk to can see your IP address. This is a property of Tox.
  • Keys and history are not encrypted at rest. Do not share the account.
  • Rooms have no full history sync. A new member gets only the last 20 messages, from the creator.
  • The members of a room must be contacts of each other.

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

To release, tag vX.Y.Z on master. GitHub Actions then publishes the package to PyPI. See docs/release.md. The engine version and the plugin version change together. tests/test_versions.py checks this.

Metadata

Release files for toxi 0.6.4

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.6.4
File Size Uploaded Provenance
toxi-0.6.4.tar.gz 301.5 kB With provenance Details

Built distribution (wheel)

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

Total release size: 384.5 kB

Release files / toxi-0.6.4.tar.gz

Download URL toxi-0.6.4.tar.gz
Size 301.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ebcb95d9e1b5caaf97fd39eda7d6a11fb6aacd5cf4aec6ed0b34cffe332cc148
BLAKE2b-256 checksum
How to use checksums
0a075c2d402beb392250a9f6fd9a7f5bae783f63dcae4a582437f37a8de2687f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 23, 2026.

Transparency log

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

Download URL toxi-0.6.4-py3-none-any.whl
Size 83.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1cf3dc1af13e59a00694fbd2c647285af701442d75db487205c3c0971f27cb6
BLAKE2b-256 checksum
How to use checksums
fb5b0a7e0b8b88e93ac61f0043f7db95589a5bcdbf310d7922d85a4892a9056e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 23, 2026.

Transparency log

Security for toxi 0.6.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for toxi-0.6.4.tar.gz

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 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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