/cave-teams:cave-messagesfrom cave-teams
The file-message substrate of the leader-driven runtime — a message IS a JSON file, dispatch is a POINTER (never the payload), the session dir is task.txt/leader_outbox/inbox/messages/artifacts. Use when you need to understand how agents actually communicate in a real cave-team run, where the files land on disk, or how the guardrail reads the log. Triggers: "message files", "how do agents talk", "the file spine", "team session dir", "pointer not payload", "cave-messages".
Ships in cave-teams. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This is the main thing (cave-teams rule 01). In a real cave-team run, agents do not pass strings to each other in memory — a message IS a file in the team's dir, and cave-teams watches that dir, checks each message against the guardrails, and dispatches only when conditions are met.
This is the substrate under the cave-run-team runtime and the cave-leader loop. Read those two next; this skill is what they write to disk.
TeamMessageOne message = one JSON file. The dataclass (cave_teams.messages.TeamMessage):
TeamMessage(frm, to, kind=RESPONSE, path="", text="",
one_liner_to_show_user="", data={}, id=<12-hex>, ts=<time>)
kind is a small, stable vocabulary (so guardrail conditions can switch on it):
DISPATCH (runtime/leader → agent: a pointer, "read {path}"), RESPONSE (agent → team: the
final answer, written into the dir), FLAG (a condition flag was set), DONE (the team finished).path (a file under artifacts/); text
stays small (a ~200-char preview). A dispatch says "read this file" — it never inlines the
payload. This is the never-truncate rule: a large payload stays a POINTER, never a slice.one_liner_to_show_user is the human-facing 1-line status the dashboard renders.cave_teams.session.TeamSession lays out one run under <team_dir>/sessions/<session_id>/:
task.txt # the task; the leader is told to check it
leader_outbox/ # the leader WRITES its proposed message file here (msg_001.json, …)
inbox/<teammate>/ # DELIVERED (post-guardrail) messages — what each teammate reads
messages/ # the flat team-event LOG (every dispatch + response) — conditions read THIS
artifacts/ # the payloads that message pointers reference (e.g. <name>-response-3.txt)
The guardrail gate sits between leader_outbox/ (proposed) and inbox/<teammate>/ (delivered):
a message is copied into a teammate's inbox only after it passes the check (see cave-leader).
messages/ is the append-only event log — one JSON file per event, named <ts>-<frm>-<id>.json,
read in timestamp order. Guardrail conditions read the log to decide whose turn it is.
leader writes leader_outbox/msg_007.json ({"to":"writer","prompt":...,"path":<researcher's artifact>})
│ cave-teams reads + CHECKS it (guardrail)
▼ valid → deliver
inbox/writer/<ts>-<id>.json + messages/<ts>-leader-<id>.json (kind=dispatch)
│ writer runs, reads the pointed-at file, produces text
▼
artifacts/writer-response-4.txt (the payload)
messages/<ts>-writer-<id>.json (kind=response, path→that artifact, text=preview)
So the information carried between two contacts is a file path: the writer's dispatch pointed at
the researcher's artifact file, the writer read it, and its own response is a new artifact. Nothing
is threaded in memory — the dir is the channel. (This is the plane the in-process >>/| DSL does
NOT use; the DSL threads a Python dict instead — see cave-teams and the cave-runtimes fork.)
Pure stdlib, no cave / no pydantic — so the channel is inspectable, replayable, and language-neutral.
cave (the central event system) is adapted to watch this dir, so it reacts to only team events,
not every LLM event. You can cat any run's messages/ afterward and read exactly what happened —
which is how you verify a team ran correctly (force the actions, then read every file).
cave-run-team (the runtime that writes these) · cave-leader (who proposes them + the guardrail) ·
cave-teams (the in-process DSL, the OTHER plane). Part of the cave-teams plugin.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub sancovp/cave-teams --plugin cave-teams21 skills in this plugin
/caveDrive the whole cave-teams library from one function, as DATA — build/run any team from a spec in any sequence, save a team to your proven library, reuse a proven team anywhere, and discover teams across projects. Use when you want to serialize a team, run a team from JSON/dict, save+reuse a proven team across repos ("golden"), or have a higher system / global app drive cave-teams. NOT how you normally program (use the cave-teams DSL for that). Triggers: "cave()", "metacontrol", "run from a spec", "team as data", "golden team", "reuse a proven team", "scan for .cave", "global cave"./cave-blackboardN agents read and write a shared state over rounds, with a mutator that folds each contribution in and an optional adjudicator (stigmergy arena). Use for agents collaborating on a shared board, a market, a workspace they all see. `blackboard()`./cave-branchRun different agents depending on a condition (guarded choice / router). Use for 'if X do this else that', routing, triage, picking a path by the state. `choice()` / `router()`./cave-conditionsProgram WHEN each agent may be messaged — conditions on messages, the GUARDRAILS of a leader-driven team run. Use to gate agents on runtime state: after these two respond, only when a flag holds, any predicate over the message log. THIS is what makes cave-teams programmable where Claude Code Teams' flow is fixed./cave-dagRun agents on a dependency graph — each fires when its inputs are ready (the general scheduler; sequential and parallel are its limits). Use for 'merge after frontend AND backend', diamond/fan-in dependencies, partial orders. `dag()`./cave-dovetailHand off specific named data from one agent to the next, typed (load files, validate expected outputs, map outputs→inputs). Use when step B needs particular named inputs produced by step A, not just the raw text. `dovetail()`.