/duet:duet [claude|codex|kimi|opencode[=count] ...]from duet
Start a live tmux or Windows/psmux mesh of Claude, Codex, Kimi, and OpenCode agents that message each other directly. No leader and no roles; the agent given the task coordinates by convention.
Ships in duet. 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.
Start two to thirteen named coding agents in one terminal-multiplexer session.
Large rosters are sharded across windows with at most five panes each. You
are the initiator (claude); requested peers use instance names such as
codex-1, kimi-1, opencode-1, and claude-1.
There is no leader and no enforced role. Any agent may message any other
agent or broadcast to all. You coordinate by convention because the human
gave you the task: divide the goal, hand peers scoped work, integrate replies,
and speak to the user.
The invocation arguments are: $ARGUMENTS
Treat each whitespace-separated argument only as harness or
harness=count, where harness is claude, codex, kimi, or opencode and
count is a canonical positive decimal. The expanded roster may contain one to
twelve workers. Reject options, shell syntax, zero, signs, leading zeroes, and
an expanded roster above twelve. An empty list is the normal case: the start
command takes no roster specs, restores a previously
paired roster when one matches, and otherwise starts the default fresh
ensemble (you plus one Codex and one Kimi worker). Explicit specs pin an exact
roster instead. Every requested CLI must already be installed and
authenticated.
Use the Windows path when running on Windows/PowerShell with psmux; otherwise
use Bash/tmux. If the matching TMUX/TMUX_PANE environment is absent, tell
the user to relaunch Claude inside the appropriate multiplexer and invoke duet
again.
macOS/Linux — the normal start command is duet-rejoin.sh with no harness
words: when a complete pairing for this repo names your current native
session it restores that whole paired roster (stable names, resumed worker
contexts); otherwise it starts the default fresh ensemble (you plus one Codex
and one Kimi worker). Pass your current native session id through
(CLAUDE_CODE_SESSION_ID is exported to your tool environment; leave the
expansion exactly as written — never substitute a guessed id):
DUET_INITIATOR_NATIVE_ID="${CLAUDE_CODE_SESSION_ID:-}" \
bash "${CLAUDE_PLUGIN_ROOT}/scripts/duet-rejoin.sh"
Only when the human explicitly requested a roster, append those roster specs
(for example …duet-rejoin.sh codex=2 kimi); explicit specs must match a
found mapping's roster exactly, otherwise a fresh ensemble with exactly those
workers starts.
Native pairing/rejoin supports Claude, Codex, and Kimi only. An explicit roster containing OpenCode always starts fresh and retains only a diagnostic pairing record; never infer an OpenCode native id from its machine-global session list.
Rejoin refuses only when the previous run still owns live panes; then end that
session (duet-end.sh with its pinned config) and run the same command again.
End the active Duet run before using /new, /clear, a session picker, or
fork to switch this pane's native harness session.
Windows — two verbs, start or resume. To start:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:CLAUDE_PLUGIN_ROOT\scripts\duet-init.ps1" codex kimi
To bring a previously started session back, from its workdir:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:CLAUDE_PLUGIN_ROOT\scripts\duet-resume.ps1"
Resume picks the most recently touched session for this workdir; pass
-Session <duet.env> to pin one exactly, -List to see every recorded
session, or -DryRun to assess without starting anything. It verifies each
member from a captured pane render, not from a live pid, and retains those
frames under <session>/recovery/<attempt>/. It reports every member it
cannot restore by name and refuses rather than refilling that name with a
fresh process; it never moves a live pane, because relocating one kills the
agent. A member listed as offscreen is alive in another window — select that
window rather than moving it. Windows native-session pairing is not yet wired,
so a resumed member's harness-native context is not yet restored; that is
tracked in issue #18.
Start renders the mesh brief into AGENTS.md and CLAUDE.md, launches peers,
starts one delivery daemon, and waits for readiness. Report any readiness
failure.
Retain the absolute config from duet: session <directory>. Every mutation
reads that exact file from DUET_CONFIG; diagnostics take it explicitly.
There is no current-pointer or session-id fallback. Concurrent sessions use
separate git worktrees so their instruction anchors do not collide.
Use exact roster names. Send directly to one peer or broadcast to all, which
skips the sender and any dead or blocked member.
macOS/Linux:
DUET_CONFIG="/absolute/session/duet.env" \
bash "${CLAUDE_PLUGIN_ROOT}/scripts/duet-send.sh" codex-1 <<'DUET_EOF'
...your message...
DUET_EOF
Windows PowerShell:
$env:DUET_CONFIG = 'C:\absolute\session\duet.env'
@'
...your message...
'@ | powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:CLAUDE_PLUGIN_ROOT\scripts\duet-send.ps1" codex-1
Add --interrupt (Bash) or -Interrupt (PowerShell) only for an urgent
redirect. queued <id> means the immutable queue file was published; the
daemon delivers it asynchronously.
Messages arrive with
[DUET ref=<D10> session=<sid> id=<id> from=<name> to=<name|all>]. Delivery is
at-least-once: suppress repeated IDs, reply once to the exact from, then wait.
Human messages have no DUET header.
In a live session every message becomes delivered or rejected, or its recipient
is surfaced as dead or blocked — never silent limbo. Busy peers use their
harness's native queue or, on Windows where declared, an owned steer path.
Unreadable or ambiguous UI is retried and can eventually block only that
recipient rather than falsely report delivery. A blocked peer can be returned
to the session once its pane is alive and idle —
duet-unblock.sh <name> on macOS/Linux, duet-unblock.ps1 <name> -Session <duet.env>
on Windows — and delivery continues from its queue head without ever repasting
a message that may already have landed. If a peer seems unresponsive, check
status.
macOS/Linux:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/duet-status.sh" --session "/absolute/session/duet.env"
bash "${CLAUDE_PLUGIN_ROOT}/scripts/duet-doctor.sh" --session "/absolute/session/duet.env"
Windows:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:CLAUDE_PLUGIN_ROOT\scripts\duet-status.ps1" -Session "C:\absolute\session\duet.env"
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:CLAUDE_PLUGIN_ROOT\scripts\duet-doctor.ps1" -Session "C:\absolute\session\duet.env"
To return a blocked peer to the session once its pane is alive and idle:
macOS/Linux:
DUET_CONFIG="/absolute/session/duet.env" \
bash "${CLAUDE_PLUGIN_ROOT}/scripts/duet-unblock.sh" kimi-1
Windows:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:CLAUDE_PLUGIN_ROOT\scripts\duet-unblock.ps1" kimi-1 -Session "C:\absolute\session\duet.env"
End is immediate—no drain and no DUET-END ritual. First ensure no send is in
flight and required results were delivered.
macOS/Linux:
DUET_CONFIG="/absolute/session/duet.env" \
bash "${CLAUDE_PLUGIN_ROOT}/scripts/duet-end.sh"
Windows:
$env:DUET_CONFIG = 'C:\absolute\session\duet.env'
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:CLAUDE_PLUGIN_ROOT\scripts\duet-end.ps1"
End stops the daemon and other spawned panes; its caller survives. A crashed or wedged session is discarded and re-initialized, never recovered or replayed.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub jonathanrosado/duet-agents --plugin duet