/cave-teams:cave-run-teamfrom cave-teams
The leader-driven runtime entry points — run_team (pure, in-process teammates, one event loop) and cave_team (spins up an ephemeral headless CAVE HTTP server + a live /team dashboard, tears it down). Use when you want to actually RUN a real multi-agent team with message files + a leader, not the in-process >>/| DSL. Triggers: "run a real team", "run_team", "cave_team", "ephemeral cave server", "team dashboard", "leader-driven run", "force the agents to run", "cave-run-team".
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 runtime that executes the leader-driven plane (the one where messages are files and a leader routes them). Two entry points, same loop underneath.
Prereqs: cave-leader (who drives it) + cave-messages (what it writes to disk). The other plane — the in-process
>>/|DSL run by.execute()— is cave-teams; this is the fork called out in cave-runtimes.
run_team_async (in cave_teams.runner) does this, in one event loop:
compile_to_edges(team.build()) → the closed-world guardrails; team_agents = the members.TeamSession (writes task.txt, makes leader_outbox/ inbox/ messages/ artifacts/).max_steps:
ctx (task, log, in_flight, last alert, any error) and ask the leader to propose;check_proposal the proposal — on error, re-prompt the leader with {e} (up to max_fixes);end → emit the report and return; wait → block on the next finish;deliver the message into each target's inbox + log it, start each teammate as
a concurrent task, then _reap_one (alert the leader as the next teammate finishes).artifacts/<name>-response-N.txt; a RESPONSE message
(pointer to that file) is logged.run_team — the pure entry point (no server, no cave)from cave_teams import run_team
res = run_team(
team, # a Team / composed topology (its edges = the guardrails)
task="build and review X",
leader=my_leader, # a LeaderFn — raw | llm_leader(rt) | file_leader(rt) (see cave-leader)
teammate_runtimes={"researcher": rt1, "writer": rt2}, # name -> any object with .run(str)
team_dir="/tmp/myteam",
open_rules={"researcher": ["cite sources"]}, # optional, leader-judged
max_steps=100, max_fixes=3,
)
# res: {"ok": bool, "report"|"error": str, "transcript": [...], "messages": [ {...}, ... ]}
Sync — it wraps run_team_async in a single asyncio.run so async runtimes share the loop. Do not
wrap run_team in your own asyncio.run (it already owns the loop). Teammates can be tool-less
(they just return text). Everything is on disk in team_dir/sessions/session/ afterward — read it.
cave_team — the ephemeral-server runtime (+ live dashboard)Spins up a new headless CAVEHTTPServer hosting the leader + teammates as real CAVE agents,
runs the team leader-driven, then tears the server down. Requires cave installed.
from cave_teams import cave_team
res = cave_team(
team,
agent_runtimes={"researcher": rt1, "writer": rt2}, # teammates (CAVE set_runtime backends)
leader_runtime=minimax_with_file_tools, # the leader — needs FILE TOOLS (file_leader)
task="build and review X",
leader_name="leader",
open_rules=None, base_dir="/tmp/cave_teams",
serve=True, port=None, # serve=True → a live /team dashboard on a free port
max_steps=30, linger=0, # linger>0 keeps the dashboard up after the run for inspection
)
# res adds: res["team_dir"], res["dashboard"] = "http://127.0.0.1:<port>/team?live"
file_leader (it writes its JSON message into leader_outbox/ via
its file-editing tool). So leader_runtime MUST have file tools (e.g. MiniMaxRuntime(tools=None)
→ BashTool + NetworkEditTool). Teammates can be tool-less./team (a gallery UI) + /team/events (a team-event SSE — only team events, not
cave's full LLM firehose). Set CAVE_TEAMS_GALLERY_URL to also forward events to a standing app.parent_id so a gallery can indent them.run_team — tests, headless CI, when you supply your own runtimes and don't need cave/a UI.
Pure stdlib channel + your leader. This is what you use to force every topology to run and then
read the message files.cave_team — when you want the real CAVE server + the live dashboard, with CAVE agents and a
file-writing leader. The production surface.Both return the full messages log and leave team_dir/sessions/<id>/ on disk. To prove a team ran
correctly: run it, then read every file — messages/*.json (the event order), inbox/<t>/
(what each teammate was actually handed), artifacts/* (what each produced), and the transcript
(each dispatch, block, and finish-alert). The guardrail blocking an out-of-turn dispatch shows up as
a {"blocked": "...", ...} transcript entry — that IS the state machine working.
cave-leader · cave-messages · cave (drive this from a data spec via the team_run op) ·
cave-teams (the in-process 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()`.