Skip to main content

Appendix A: Command Reference

A complete reference for every command and tool call referenced in this book. Organized by surface: maw CLI, tmux spawn pattern, Agent tool, TeamCreate protocol, and supporting tools (SendMessage, TaskCreate, TaskList, TaskUpdate).


A.1 maw CLI (maw-js v2.0.0-alpha.2)

Agent lifecycle

CommandPurpose
maw wake <oracle> --new <name>Create a new tmux session running a Claude agent under the given oracle identity.
maw wake <oracle> --new <name> --issue <n>As above, seeded with GitHub issue n. Caveat: cross-repo resolution is broken in v2.0.0-alpha.2 (see Chapter 14.6).
maw wake <oracle> --new <name> --repo <owner/repo>Target a specific repo. Caveat: interacts poorly with --new.
maw peek <name>Live-render the named tmux session's terminal.
maw overview <name1> <name2> ...War-room view: state of multiple agents at once.
tmux kill-session -t <name>Hard stop an agent. Manual cleanup; see Appendix B for shutdown protocol.

Messaging

CommandPurpose
maw hey <target> "<message>"Send a plain-text message to another oracle's tmux pane. Federation-native.
maw inbox write "<message>"Persist a message to the oracle's inbox. Survives session death.
maw inbox readRead unread inbox messages.
maw inbox listList all inbox entries.

Federation

CommandPurpose
maw peersList known federation peers.
maw federation statusShow health across peers.
maw updatePull latest maw-js, re-link SDK, refresh plugin catalog.

Plugins

CommandPurpose
maw plugin install <name>Install a plugin from maw-commands catalog via copyFileSync.
maw plugin install <name> --dir <path>Install to a custom directory.
maw plugin listList installed plugins.
maw plugin remove <name>Remove an installed plugin.

Observability

CommandPurpose
maw worktreesList all git worktrees, flag stale ones.
maw doctorHealth check: SDK link, federation, plugin catalog, node version.
maw feedRecent activity across the federation.
maw costsToken and API cost summary.
maw logsTail the maw-js server log.

A.2 Tmux Spawn Pattern (Tier 3)

The working pattern (attempt 4 from Chapter 14 / blog post):

MAW_JS="/home/neo/Code/github.com/Soul-Brews-Studio/maw-js"

tmux new-session -d -s wasm-host -c "$MAW_JS"
# Clean way — maw hey wraps tmux send-keys, handles cross-node over WireGuard
maw hey wasm-host "claude --dangerously-skip-permissions -p '
STEP 1: Read the issue — gh issue view 317
STEP 2: Read code — src/cli/command-registry.ts
STEP 3: Implement host functions
STEP 4: Branch, commit, push
STEP 5: Every 5 min, report:
maw hey mawjs-oracle \"[wasm-host] PROGRESS: <what>\"
STEP 6: When done or stuck:
maw hey mawjs-oracle \"[wasm-host] DONE: <branch>\"
maw hey mawjs-oracle \"[wasm-host] STUCK: <reason>\"
'"
# Under the hood it's: tmux send-keys -t wasm-host "claude --dangerously-skip-permissions -p '...'" Enter

Notes:

  • -d detaches immediately; session runs in background.
  • -c <dir> sets the working directory.
  • claude -p "<prompt>" runs the prompt and exits. Bake all instructions, including reporting, into the initial prompt.
  • Follow-up instructions can be sent with a second maw hey call (under the hood: tmux send-keys), but the agent must still be alive to receive them.

A.3 Agent Tool (Tier 1)

In-process subagent. Spawned from inside a running Claude session.

{
"description": "Explore Elysia source tree",
"subagent_type": "Explore",
"prompt": "Find where the error() helper is defined in node_modules/elysia/src. Report file path and exports."
}

Fields

FieldRequiredNotes
descriptionYes3-5 word label.
promptYesFull self-contained task. Agent has no memory of the parent conversation.
subagent_typeNogeneral-purpose (default), Explore, Plan, or named agent.
modelNosonnet, opus, haiku. Haiku for parallel research, Opus for debates.
isolationNoworktree creates a git worktree; auto-cleans if no changes.
run_in_backgroundNoReturns immediately; result delivered later.

Typical invocations

Research swarm (5 parallel Haiku):

{
"description": "Map Elysia plugin system",
"subagent_type": "Explore",
"model": "haiku",
"prompt": "Read ψ/learn/elysiajs/elysia/origin/src/plugin.ts and report the plugin lifecycle in under 200 words."
}

Architecture debate (3 Opus):

{
"description": "SDK-everywhere vs hybrid",
"model": "opus",
"prompt": "Advocate for per-endpoint SDK wrappers (20+ methods). Full arguments in 400 words. Address maintenance burden, type safety, plugin ergonomics."
}

Worktree implementation:

{
"description": "Migrate API batch 1 (7 files)",
"isolation": "worktree",
"prompt": "In this worktree, migrate src/api/{auth,users,posts,...}.ts from Hono to Elysia. Follow the pattern in the already-migrated src/api/health.ts. Commit and push feat/elysia-batch1. Report back with branch name."
}

A.4 TeamCreate Protocol (Tier 2)

Create a team

Open a coordinated squad. Lead agent (the caller) is implicit. Teammates are spawned via Agent calls referencing the team.

// TeamCreate
{
"name": "wasm-hardening",
"members": [
{"name": "safety", "role": "verify memory and gas caps"},
{"name": "tester", "role": "write integration tests"},
{"name": "rust-verifier", "role": "confirm Rust SDK compiles"}
]
}

Assign tasks

// TaskCreate
{
"subject": "Verify 16MB memory cap enforcement",
"activeForm": "Verifying memory cap",
"owner": "safety"
}

Teammate reports back

// From teammate, via SendMessage
{
"to": "team-lead",
"summary": "Memory cap verified",
"message": "All 3 allocation paths bounded at 16MB. See commit abc123."
}

Shutdown protocol

Lead requests shutdown; teammate approves; lead deletes team.

// Lead → teammate
{"to": "safety", "message": {"type": "shutdown_request", "reason": "work complete"}}

// Teammate → lead
{"to": "team-lead", "message": {"type": "shutdown_response", "request_id": "...", "approve": true}}

// Lead
// TeamDelete({name: "wasm-hardening"})

A.5 Task Tools

ToolPurpose
TaskCreateAdd a task to the shared list. subject, activeForm, optional owner.
TaskListRead the full task list.
TaskGet({taskId})Read one task.
TaskUpdate({taskId, status})Move a task to in_progress, completed, or deleted.
TaskOutput({taskId})Pull output produced by the task owner.
TaskStop({taskId})Abort a running task.

Dependencies

{"taskId": "3", "addBlockedBy": ["1", "2"]}

Task 3 will not start until 1 and 2 are complete.


A.6 SendMessage (Tier 2 Message Bus)

{
"to": "safety",
"summary": "Review this PR",
"message": "Please verify wasm/host-functions.ts against the gas budget in spec.md."
}
  • to: teammate name, or "*" for broadcast (use sparingly).
  • summary: 5-10 word preview.
  • message: plain text, or structured protocol object (shutdown, plan approval).

A.7 Cron And Scheduled Agents

ToolPurpose
CronCreateSchedule a recurring agent.
CronListList scheduled agents.
CronDeleteCancel a schedule.
ScheduleWakeupSelf-pace inside a /loop skill invocation.
RemoteTriggerFire a scheduled agent manually.

Used in Chapter 9 for the 5-minute cron loop that built 17 plugins.


A.8 Worktree Tools

ToolPurpose
EnterWorktreeMove into an isolated worktree for the rest of the session.
ExitWorktreeLeave the worktree; return to primary checkout.

Use with Agent({isolation: "worktree"}) for per-agent isolation.


A.9 Plan Mode

ToolPurpose
EnterPlanModeSwitch to plan-only mode; no writes until approved.
ExitPlanModeCommit the plan and resume normal operation.

Useful when spawning agents you do not fully trust yet — have them plan first, approve, then execute.


A.10 Cross-Reference

ChapterCommands used
Ch 3 (Message Bus)SendMessage, maw hey, maw inbox
Ch 4 (Task Tracking)TaskCreate, TaskList, TaskUpdate
Ch 5 (Research Swarm)Agent × 5 Haiku
Ch 6 (Debate)Agent × 3 Opus
Ch 7 (Implementation Team)TeamCreate, Agent with isolation: worktree
Ch 8 (Federation Agent)tmux new-session, claude -p, maw hey, maw peek
Ch 9 (Cron Loop)CronCreate, ScheduleWakeup
Ch 13 (Human Sees)maw peek, maw overview
Ch 15 (Future)maw wake --issue --team (proposed)