mash

module
v0.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0

README

mash

release CI security checks quick start Ask DeepWiki

mash ("mail mesh") gives each of your AI agent sessions an inbox that keeps its mail. The inbox lives on a NATS server (NATS is an open-source message server). Mail waits (in a single-replica inbox; see durability), signed by its sender, until the recipient has seen it, whether that session is busy, idle or stopped, on this machine or another. In Claude Code it arrives by itself: no polling, no extra turns for mail that can wait.

mash is deliberately small: one Go binary per agent (an "agent" here is one running Claude Code session, named by you; the docs also call it an endpoint), one outbound connection to one NATS server, no open ports and no per-agent server. It layers an opinionated approach to agent communication on top of the Synadia Agent Protocol (SAP) and NATS.

What each layer does: the stack.

The key values that mash provides:

  1. Fast, durable, secure mail between agents.
  2. No polling, no blocking, no extra turns.
  3. Location-agnostic.
  4. Agent discovery and presence.
  5. Agent wake on urgent message delivery.
  6. Agent-agnostic (ROADMAP).
  7. Messaging policy (ROADMAP).

If you are an agent

Install the mash-setup plugin and use its setup skill: it asks the person before each step. Never pipe a download into a shell. The person decides every answer.

Use mash when your agents are sessions you run, in one NATS account, working on related problems, and messages must wait for a busy or stopped recipient. Use A2A when agents belong to different teams or organisations and are called as services; use MCP to give a model tools and data. The two can sit side by side: A2A at the edge, mash inside. See how mash compares, including "why not A2A?".

Why not Claude Code's built-in cross-session messaging? It is tied to one agent host and one user, needs a claude.ai sign-in to reach another machine, holds mail for an offline session only until it reconnects, and describes no sender proof. Use mash when mail must outlive the recipient's session, when you want signed sender proof with trust labels, when you run your own NATS server, or when more than one user or machine is involved. The comparison table is in architecture.md, and comparison.md says when the built-in feature is the better choice.

How mash connects sessions

Two paths, one bus: live traffic (presence, status, live prompts) rides plain NATS and is not stored; mail rides JetStream (the NATS feature that stores messages on the server) and is kept up to 30 days. (details)

Status: v0.5.6, pre-1.0. One host adapter (Claude Code). Linux and macOS, amd64 and arm64; Windows is not supported (WSL 2 with the Linux binary is expected to work but has not been tested). Interfaces may still change before 1.0. Known limits are listed in the comparison.

Get started

mash gives each Claude Code session an inbox. Here two sessions on one machine mail each other. You need Ubuntu, Debian or macOS, git and Claude Code. Everything is installed in your home folder, with no sudo.

  1. Add the setup skill:

    claude plugin marketplace add bogworks/mash
    claude plugin install mash-setup@mash
    
  2. In a Claude Code session, say:

    Set mash up on this machine, with two agents: acme.demo.alice and acme.demo.bob.

    It asks before each step: the programs it needs, a local NATS server, the mash plugin, and the two agents.

  3. Start a session as each agent, in two terminals. The setup wrote one command for each agent, so you type one word:

    bob
    alice
    

    Each starts Claude Code with its address as the session's name, so you can tell who you are talking to (for a session already open, type /rename acme.demo.alice), and says on its first turn whether mail wakes it when idle. That wake needs Claude Code to load mash's channel, which depends on your account: see wake an idle session. Without it, mail arrives at the session's next prompt or tool call. Claude Code asks whether to trust the folder; choose yes.

  4. In Bob's session, say: "Send alice a note: lunch at noon?" In Alice's, say: "Do I have mail?" She sees Bob's note, marked verified, after the setup's own test note.

Mail waits. Close Alice's session, send again from Bob's, reopen hers, and it is there.

  • Watch it first: a 2-minute video of these steps, recorded on a personal Claude account with the development flag, as the setup skill offers.
  • Something wrong: mash doctor, then troubleshooting.
  • The same thing, typed yourself: by hand.
  • How mash, SAP and NATS fit together: the stack.
  • Remove everything: uninstall.

Check the download

install.sh checks each binary against the release's SHA256SUMS. When a current GitHub CLI (gh) is installed it also verifies SHA256SUMS against the release's build attestation (a record signed by GitHub that the release workflow built these files from the release tag), and installs nothing if that fails. Without gh it says so and trusts the TLS connection to github.com. gh attestation verify needs a current gh; which version, and where to get it. To check by hand before you run anything, download the files and verify the attestation:

BASE=https://github.com/bogworks/mash/releases/download/v0.5.6
curl -fsSLO $BASE/install.sh -O $BASE/SHA256SUMS -O $BASE/mash.intoto.jsonl &&
gh attestation verify SHA256SUMS -R bogworks/mash --bundle mash.intoto.jsonl \
  --signer-workflow bogworks/mash/.github/workflows/release.yml --source-ref refs/tags/v0.5.6

The rest (checking install.sh itself against SHA256SUMS, and building from source) is in docs/install.md.

Documentation

Synadia Cloud

Synadia Cloud is not supported by mashctl in 0.5.6: see docs/synadia.md.

Addresses and the Synadia Agent Protocol

mash is a SAP agent per session, with one departure: an endpoint is addressed owner.group.instance, and the owner (not the harness) takes the first subject slot, so a credential can be fenced to its owner. Details, and what that means for discovery, are in docs/sap.md.

What you get

  • Mail that waits. Each agent (endpoint) has its own JetStream inbox stream, a stored queue of its mail on the server. Mail sent to a session that is busy, asleep or not running waits up to 30 days, and arrives the moment the session can take it.
  • Mail kinds cut turn cost. mash send --kind (or the send tool's kind) marks mail blocker, question or task (wakes an idle session) or result or fyi (opt-in; waits for the session's next turn); with no kind a send is task.
  • No polling turns. Mail that lands mid-turn rides along with the next tool result (a hook). An idle session is woken by the mail itself: after 45 seconds unshown (MASH_IDLE_WAKE) if the mail is a blocker, question or task, at once for urgent mail from a verified sender, and again with backoff if a wake starts no turn. A burst arrives as one turn. The wake needs Claude Code to load mash's channel, which depends on your account (wake an idle session). A small batch arrives in full; a large one arrives as a digest, and Claude reads the messages it cares about.
  • Fast replies. The session answers through tools on the same process that holds the NATS connection open: no subprocess, no CLI, one network round trip.
  • Verified senders. Every message is signed with the sender's own NATS key (SAP §13), and the receiver checks it against a directory. A forged message is dropped; an unproven one is labelled as such.
  • Unique endpoints. One NATS user per address, and a lease (a claim on the address, held while the session runs) that refuses a second live session under the same address. A credential reaches only its own owner: it may mail any endpoint of that owner and no other owner's.
  • Live prompts too. Because each session is a SAP agent, you can mash prompt it (or use any SAP client) and get a streamed answer.

Messaging policy is not in this release; see what is coming in 0.6.0.

How it works

The design, with every subject, permission and limit, is in docs/specs/2026-10-21-mash-design.md.

Releases

How releases are built and checked: docs/release.md.

Changelog

What changed in each release: CHANGELOG.md.

Contributing

See CONTRIBUTING.md. Everyone taking part follows the Code of Conduct.

License

Apache-2.0. See LICENSE.

Directories

Path Synopsis
cmd
mash command
Command mash is a messaging mesh for agents: a Claude Code channel server (mash serve), and a CLI for people and scripts.
Command mash is a messaging mesh for agents: a Claude Code channel server (mash serve), and a CLI for people and scripts.
mashctl command
Command mashctl administers a mash deployment: it creates the directory and lease buckets, sets endpoint metadata, and prints limits and the NATS permissions an endpoint user needs.
Command mashctl administers a mash deployment: it creates the directory and lease buckets, sets endpoint metadata, and prints limits and the NATS permissions an endpoint user needs.
internal
admin
Package admin provisions mash endpoints: the permission template a NATS user needs, and the streams, consumer and directory record behind it.
Package admin provisions mash endpoints: the permission template a NATS user needs, and the streams, consumer and directory record behind it.
adrindex
Package adrindex generates docs/decisions/INDEX.md from the records' front matter (ADR 0068).
Package adrindex generates docs/decisions/INDEX.md from the records' front matter (ADR 0068).
apply
Package apply is mashctl's view of the account resolver through the system account (ADR 0052): it looks the account JWT up on the servers, pushes a revision of it signed with the operator key, and reads it back to verify.
Package apply is mashctl's view of the account resolver through the system account (ADR 0052): it looks the account JWT up on the servers, pushes a revision of it signed with the operator key, and reads it back to verify.
claudesettings
Package claudesettings reads Claude Code's managed settings, read-only, to say whether mash is on the channel allowlist.
Package claudesettings reads Claude Code's managed settings, read-only, to say whether mash is on the channel allowlist.
cliframe
Package cliframe is the frame shared by the mash and mashctl command lines: the global options, accepted anywhere in the arguments, and the error report.
Package cliframe is the frame shared by the mash and mashctl command lines: the global options, accepted anywhere in the arguments, and the error report.
cmdcore
Package cmdcore defines a command once and serves it through both doors: the command line and an MCP tool.
Package cmdcore defines a command once and serves it through both doors: the command line and an MCP tool.
cmdcore/cmds
Package cmds holds the commands defined on cmdcore: each is a params struct, a result struct and a Run, served through both the command line and the MCP tool.
Package cmds holds the commands defined on cmdcore: each is a params struct, a result struct and a Run, served through both the command line and the MCP tool.
cmdcore/render
Package render holds the small text helpers shared by the commands' human output: relative times, aligned tables, the terminal width, colour and plural counts.
Package render holds the small text helpers shared by the commands' human output: relative times, aligned tables, the terminal width, colour and plural counts.
config
Package config loads mash's settings: config.json in the config directory (see ConfigDir), then the environment, which wins.
Package config loads mash's settings: config.json in the config directory (see ConfigDir), then the environment, which wins.
ctl
Package ctl is the admin verb set of mashctl.
Package ctl is the admin verb set of mashctl.
ctlkeys
Package ctlkeys is the key store of mashctl: the account signing seed (and the operator and system keys of a server `mashctl init --local` stood up), kept as 0600 files in a 0700 directory (ADR 0052).
Package ctlkeys is the key store of mashctl: the account signing seed (and the operator and system keys of a server `mashctl init --local` stood up), kept as 0600 files in a 0700 directory (ADR 0052).
endpoint
Package endpoint is one mash endpoint: its NATS connection, identity, lease, inbox and view of the directory.
Package endpoint is one mash endpoint: its NATS connection, identity, lease, inbox and view of the directory.
enroll
Package enroll signs the user credential of an endpoint from a PUBLIC key the endpoint made, so no private key reaches the central host, and records the endpoint (issue record, directory record, inbox).
Package enroll signs the user credential of an endpoint from a PUBLIC key the endpoint made, so no private key reaches the central host, and records the endpoint (issue record, directory record, inbox).
host
Package host isolates what is specific to the agent host a mash session runs in (Claude Code today), so other hosts (Hermes, Pi) can plug in later.
Package host isolates what is specific to the agent host a mash session runs in (Claude Code today), so other hosts (Hermes, Pi) can plug in later.
issue
Package issue is the issue service (REQ-013, ADR 0104): it takes a request that holds a sender's PUBLIC key and the address the key is for, countersigned by the requester on the sender's host, and returns a user JWT for that key, signed with the owner group's scoped signing key and carrying the tags mash's own table gives that address.
Package issue is the issue service (REQ-013, ADR 0104): it takes a request that holds a sender's PUBLIC key and the address the key is for, countersigned by the requester on the sender's host, and returns a user JWT for that key, signed with the owner group's scoped signing key and carrying the tags mash's own table gives that address.
joinfile
Package joinfile is the join file: the one text file whoever runs a mesh hands to a machine that is to join it.
Package joinfile is the join file: the one text file whoever runs a mesh hands to a machine that is to join it.
keycred
Package keycred makes a user key pair.
Package keycred makes a user key pair.
kind
Package kind is a message's kind: what the sender wants of the recipient, which decides whether it wakes an idle session.
Package kind is a message's kind: what the sender wants of the recipient, which decides whether it wakes an idle session.
listset
Package listset turns a list set into scoped-key permission templates and per-sender tags, and refuses to produce anything the NATS server would not enforce exactly as the lists say.
Package listset turns a list set into scoped-key permission templates and per-sender tags, and refuses to produce anything the NATS server would not enforce exactly as the lists say.
mcp
Package mcp is a minimal Model Context Protocol server over stdio, enough to be a Claude Code channel: initialize (declaring claude/channel), tools, ping, and notifications/claude/channel.
Package mcp is a minimal Model Context Protocol server over stdio, enough to be a Claude Code channel: initialize (declaring claude/channel), tools, ping, and notifications/claude/channel.
mint
Package mint makes the NATS user JWT and creds of one endpoint: signed by the account signing key and carrying the endpoint's own permission set (admin.Permissions).
Package mint makes the NATS user JWT and creds of one endpoint: signed by the account signing key and carrying the endpoint's own permission set (admin.Permissions).
namerule
Package namerule reads and applies mash's name-acceptance rule file, name-rule@1 (docs/name-rule.md, ADR 0077).
Package namerule reads and applies mash's name-acceptance rule file, name-rule@1 (docs/name-rule.md, ADR 0077).
natsauth
Package natsauth connects to NATS with a user creds file without turning the client into a signing oracle.
Package natsauth connects to NATS with a user creds file without turning the client into a signing oracle.
natsfixture
Package natsfixture is test fixtures only: nothing in a release binary may import it (isolation_test.go checks).
Package natsfixture is test fixtures only: nothing in a release binary may import it (isolation_test.go checks).
policy
Package policy holds the size limits the JWTs mash makes must fit.
Package policy holds the size limits the JWTs mash makes must fit.
policyapply
Package policyapply is the core of the applied-policy gate (contract mash-messaging-policy REQ-011, draft-3).
Package policyapply is the core of the applied-policy gate (contract mash-messaging-policy REQ-011, draft-3).
policydoc
Package policydoc decodes the list-set document: the one value per account that a policy author keeps and mash applies.
Package policydoc decodes the list-set document: the one value per account that a policy author keeps and mash applies.
policyintake
Package policyintake is the intake of list sets: it watches the key `listset.<account>` of the policy bucket, checks each delivered revision against the account's adoption marker, hands a verified list set to an applier and reports every refusal.
Package policyintake is the intake of list sets: it watches the key `listset.<account>` of the policy bucket, checks each delivered revision against the account's adoption marker, hands a verified list set to an applier and reports every refusal.
policyserve
Package policyserve is the production assembly of the list-set intake: the adapters the intake needs (decode, document in force, refusals, held keys, the write guard), the signer over the key store, the server limits read through the system account, and the Applier that builds everything policyapply.Apply needs for one verified document.
Package policyserve is the production assembly of the list-set intake: the adapters the intake needs (decode, document in force, refusals, held keys, the write guard), the signer over the key store, the server limits read through the system account, and the Applier that builds everything policyapply.Apply needs for one verified document.
policyview
Package policyview is the responder behind `mash policy show` and `mash policy explain` (REQ-010).
Package policyview is the responder behind `mash policy show` and `mash policy explain` (REQ-010).
portable
Package portable holds the portable-code lint: a plain go test that walks the source tree and counts places where product code carries a personal convention (a person's or machine's name, a home or temp path, a foreign GitHub org, an inline long timeout).
Package portable holds the portable-code lint: a plain go test that walks the source tree and counts places where product code carries a personal convention (a person's or machine's name, a home or temp path, a foreign GitHub org, an inline long timeout).
reconcile
Package reconcile is the first-list-set reconcile of an adopted account (AT-015, ADR 0111): it plans, and with a signer executes, the removal of what the account held before its first list set that the list set does not own.
Package reconcile is the first-list-set reconcile of an adopted account (AT-015, ADR 0111): it plans, and with a signer executes, the removal of what the account held before its first list set that the list set does not own.
refgen
Package refgen generates the plain-markdown command reference under docs/reference from the spec files in spec/.
Package refgen generates the plain-markdown command reference under docs/reference from the spec files in spec/.
releasenotes
Package releasenotes is the one place that judges a release's notes (ADR 0105, release standard rule 23): a release's notes and its change-log section are the same text, and it opens with prose before any list.
Package releasenotes is the one place that judges a release's notes (ADR 0105, release standard rule 23): a release's notes and its change-log section are the same text, and it opens with prose before any list.
render
Package render turns mail into the text a Claude session sees: a small batch in full, a large one as a digest of one line per message.
Package render turns mail into the text a Claude session sees: a small batch in full, a large one as a digest of one line per message.
requesterreg
Package requesterreg is the static requester registry: a file that says which requester public key may countersign an issue request for which host and owner group (REQ-013, ADR 0104).
Package requesterreg is the static requester registry: a file that says which requester public key may countersign an issue request for which host and owner group (REQ-013, ADR 0104).
sap
Package sap implements the parts of the Synadia Agent Protocol 0.3 that mash uses: subjects (§2), and sender identity (§13).
Package sap implements the parts of the Synadia Agent Protocol 0.3 that mash uses: subjects (§2), and sender identity (§13).
spool
Package spool is the hand-over between serve and a Claude Code session's hooks (hook delivery, mash v0.2.0).
Package spool is the hand-over between serve and a Claude Code session's hooks (hook delivery, mash v0.2.0).
store
Package store holds mash's JetStream layout: per-endpoint inbox streams, their consumer, and the directory and lease KV buckets (spec section 5).
Package store holds mash's JetStream layout: per-endpoint inbox streams, their consumer, and the directory and lease KV buckets (spec section 5).
testenv
Package testenv runs an in-process nats-server in operator mode for integration tests.
Package testenv runs an in-process nats-server in operator mode for integration tests.
scripts
adrlint command
Command adrlint enforces the architecture decision records under docs/decisions (adr-lint.yml's checker).
Command adrlint enforces the architecture decision records under docs/decisions (adr-lint.yml's checker).
buildrelease command
Command buildrelease builds mash (or mashctl, with -cmd) exactly as a release does and prints "<sha256> <path>".
Command buildrelease builds mash (or mashctl, with -cmd) exactly as a release does and prints "<sha256> <path>".
changelog command
Command changelog keeps CHANGELOG.md out of pull requests (ADR 0068): a user-facing change adds a fragment file changelog.d/<slug>.<kind>.md, and release preparation folds the fragments into CHANGELOG.md.
Command changelog keeps CHANGELOG.md out of pull requests (ADR 0068): a user-facing change adds a fragment file changelog.d/<slug>.<kind>.md, and release preparation folds the fragments into CHANGELOG.md.
dirbench command
Command dirbench is a MEASUREMENT TOOL, not product code (bogworks/mash#43, "directory polling grows with the square of the endpoint count").
Command dirbench is a MEASUREMENT TOOL, not product code (bogworks/mash#43, "directory polling grows with the square of the endpoint count").
doclint command
Command doclint checks that the repository's Markdown files conform to their syntax: the one check a docs-only change needs (ci.yml's docs-lint job; Randy 2026-11-21: "as long as they properly conform to their syntax, I don't see why anything else needs to run").
Command doclint checks that the repository's Markdown files conform to their syntax: the one check a docs-only change needs (ci.yml's docs-lint job; Randy 2026-11-21: "as long as they properly conform to their syntax, I don't see why anything else needs to run").
liveat command
Command liveat runs the live acceptance tests AT-001 to AT-003 and AT-4 (the security boundaries, at004) of the 0.5.5 endpoint-model contract against a build of this checkout.
Command liveat runs the live acceptance tests AT-001 to AT-003 and AT-4 (the security boundaries, at004) of the 0.5.5 endpoint-model contract against a build of this checkout.
liveat/nodeinit command
Command nodeinit is the only helper in an AT-005 node image.
Command nodeinit is the only helper in an AT-005 node image.
publishcheck command
Command publishcheck is publish-check.yml's checker: "publishing must be deterministic".
Command publishcheck is publish-check.yml's checker: "publishing must be deterministic".
refgen command
Command refgen generates the plain-markdown command reference under docs/reference from the spec files in spec/.
Command refgen generates the plain-markdown command reference under docs/reference from the spec files in spec/.
releasecheck command
Command release-check is mash's release gate.
Command release-check is mash's release gate.
reviewgate command
Command reviewgate is the verdict engine of the in-session review gate (ADR 0080).
Command reviewgate is the verdict engine of the in-session review gate (ADR 0080).
scrubcheck command
Command scrubcheck is a one-time verification: it finds the words in words.txt in the shipped surfaces.
Command scrubcheck is a one-time verification: it finds the words in words.txt in the shipped surfaces.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL