wanman-agent-matrix
Original:🇺🇸 English
Translated
Expert skill for using wanman, the open-source local agent matrix runtime that coordinates multiple Claude Code or Codex agents on your machine.
4installs
Sourcearadotso/trending-skills
Added on
NPX Install
npx skill4agent add aradotso/trending-skills wanman-agent-matrixTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →wanman Agent Matrix Runtime
Skill by ara.so — Daily 2026 Skills collection.
wanman is an open-source local agent matrix framework that runs a supervised network of Claude Code or Codex agents on your machine, coordinated through a JSON-RPC supervisor. Inspired by Japanese ワンマン電車 (one-man trains), it lets the human step back into an observer role while agents collaborate autonomously.
Installation & Setup
Prerequisites
- Node.js 20+
- pnpm 9+
- git
- A logged-in Claude Code or Codex CLI
Install from Source
bash
git clone git@github.com:chekusu/wanman.git wanman.dev
cd wanman.dev
pnpm install
pnpm build
# Run the CLI directly
pnpm --filter @wanman/cli exec wanman takeover /path/to/any/git/repoSingle-file Bundle
bash
pnpm --filter @wanman/cli standalone
node packages/cli/dist/wanman.mjs takeover /path/to/any/git/repoAdd to PATH
After building, symlink or alias the CLI so you can run from any project:
wanmanbash
# Example: add to PATH via shell profile
export PATH="$PATH:/path/to/wanman.dev/packages/cli/dist"
# Then from inside any git repo:
wanman takeover .Key CLI Commands
| Command | Description |
|---|---|
| Take over an existing git repo with the full agent matrix |
| Start an agent matrix for a one-shot goal |
| Send a message to an agent ( |
| Receive and mark pending messages as delivered |
| List registered agents and their current states |
| Escalate a message to the CEO agent |
| Live-stream supervisor and agent activity |
| Create a task in the shared pool |
| List all tasks |
| Get task details |
| Update task status/fields |
| Mark a task as complete |
| Create a long-lived initiative |
| List initiatives |
| Create a change capsule |
| List change capsules |
| List capsules owned by current agent |
| Store a structured artifact |
| List stored artifacts |
| Retrieve an artifact |
| Create a hypothesis to track |
| List hypotheses |
| Update hypothesis status |
| Read a shared context value |
| Write a shared context value |
| Validate skill docs reference real CLI commands |
Configuration
Environment Variables
bash
# Supervisor HTTP URL for the CLI (default: http://localhost:3120)
export WANMAN_URL=http://localhost:3120
# Identifies the current agent (set inside agent processes)
export WANMAN_AGENT_NAME=dev
# Select runtime: 'claude' (default) or 'codex'
export WANMAN_RUNTIME=claude
# Model overrides
export WANMAN_MODEL=claude-opus-4-5
export WANMAN_CODEX_MODEL=o4-mini
export WANMAN_CODEX_REASONING_EFFORT=high
# Bias Codex adapter toward lower-latency defaults
export WANMAN_CODEX_FAST=1
# Override where runtime materializes skill-activation snapshots
export WANMAN_SKILL_SNAPSHOTS_DIR=/tmp/my-skill-snapshotsAgent Configuration File
Agent definitions live in a single JSON file (typically ):
.wanman/config.jsonjson
{
"agents": [
{
"name": "ceo",
"lifecycle": "24/7",
"model": "high",
"systemPrompt": "You are the CEO agent. Coordinate all other agents, prioritize tasks, and escalate blockers."
},
{
"name": "dev",
"lifecycle": "on-demand",
"model": "standard",
"systemPrompt": "You are the dev agent. Implement features, fix bugs, and write tests."
},
{
"name": "devops",
"lifecycle": "on-demand",
"model": "standard",
"systemPrompt": "You are the devops agent. Manage CI/CD, infrastructure, and deployments."
},
{
"name": "researcher",
"lifecycle": "idle_cached",
"model": "standard",
"systemPrompt": "You are the research agent. Gather market data and synthesize findings."
}
],
"dbPath": ".wanman/wanman.db",
"port": 3120,
"workspaceRoot": ".wanman/agents"
}Agent Lifecycle Options
- — Continuous respawn loop; agent always running.
24/7 - — Idle until triggered by a message or task.
on-demand - — Idle until triggered, but preserves Claude
idle_cachedacross triggers viasession_id. Claude-only — pairing withclaude --resumeruntime is rejected at startup.codex
Model Tiers
- — Maps to highest-capability model for the selected runtime.
high - — Maps to balanced default model; overridable via
standardorWANMAN_MODEL.WANMAN_CODEX_MODEL
Architecture Overview
+----------------+ +--------------------+ +-----------------+
| wanman CLI | JSON | Supervisor | spawn | Agent process |
| (host shell) | ---RPC-->| (local process) | -------> | (Claude/Codex) |
| | /rpc | message/context/ | | per-agent $HOME|
| | | task/artifact | | per-agent wt |
+----------------+ +--------------------+ +-----------------+
| |
v v
+--------------------+ +-----------------+
| files + SQLite | | worktree |
+--------------------+ +-----------------+- The CLI communicates with the Supervisor via JSON-RPC 2.0 over HTTP.
- The Supervisor owns: message store, context store, task pool, artifact store, and spawns child agent processes.
- Each agent runs in an isolated per-agent worktree and per-agent , so agents never mutate your working directory or shell profile.
$HOME
Common Patterns & Workflows
Pattern 1: Take Over an Existing Repo
bash
# From inside the repo you want agents to work on:
cd /path/to/my-project
wanman takeover .
# Watch the agents coordinate in real time:
wanman watchPattern 2: Send a Goal and Monitor Progress
bash
# Launch agents against a specific goal
wanman run "Refactor the authentication module to use JWT tokens"
# In another terminal, watch activity stream
wanman watch
# Check agent states
wanman agents
# Escalate to CEO if blocked
wanman escalate "Dev agent is stuck on the JWT library choice, please decide"Pattern 3: Inter-Agent Messaging
bash
# Send a normal message to the dev agent
wanman send dev "Please add unit tests for the UserService class"
# Send a steering (interrupt) message to the dev agent
wanman send dev --steer "STOP current task. Critical bug in auth — fix login endpoint first"
# Receive messages as the dev agent
WANMAN_AGENT_NAME=dev wanman recv
# Receive all pending messages for any agent
wanman recvPattern 4: Task Pool Management
bash
# Create a task with a dependency on task ID abc123
wanman task create \
--title "Write integration tests" \
--description "Cover all API endpoints with integration tests" \
--agent dev \
--after abc123
# List all tasks and their statuses
wanman task list
# Get details of a specific task
wanman task get <task-id>
# Update task status
wanman task update <task-id> --status in-progress
# Mark complete
wanman task done <task-id>Pattern 5: Shared Context Store
bash
# Store shared context accessible to all agents
wanman context set api_base_url "https://api.example.com/v2"
wanman context set target_environment "staging"
# Read context values
wanman context get api_base_url
# Agents read context in their prompts automatically via the supervisorPattern 6: Artifact Storage
bash
# Store a structured artifact (e.g., research output)
wanman artifact put \
--name "market-analysis-q2" \
--type "report" \
--content "$(cat analysis.md)"
# List artifacts
wanman artifact list
# Retrieve a specific artifact
wanman artifact get <artifact-id>Pattern 7: Hypothesis Tracking
bash
# Create a hypothesis for agents to validate
wanman hypothesis create \
--title "Switching to Bun runtime reduces build time by 40%" \
--description "Based on benchmarks from similar TypeScript projects"
# List hypotheses and their validation status
wanman hypothesis list
# Update after validation
wanman hypothesis update <id> --status confirmed --evidence "Build time dropped from 45s to 26s"Pattern 8: Change Capsules
bash
# Create a change capsule (bounded unit of work/change)
wanman capsule create \
--title "Auth JWT migration" \
--description "Migrate session-based auth to JWT"
# List all capsules
wanman capsule list
# List capsules owned by the current agent
WANMAN_AGENT_NAME=dev wanman capsule mine
# Get details
wanman capsule get <capsule-id>TypeScript Integration (Host SDK)
Embed wanman into your own tools using the package:
@wanman/host-sdktypescript
import { WanmanClient } from '@wanman/host-sdk';
// Connect to a running supervisor
const client = new WanmanClient({
url: process.env.WANMAN_URL ?? 'http://localhost:3120',
});
// Send a message programmatically
await client.send({
agent: 'dev',
message: 'Please review the PR and add inline comments',
steer: false,
});
// Create a task
const task = await client.task.create({
title: 'Fix flaky tests',
description: 'Tests in auth.test.ts fail intermittently under CI',
agent: 'dev',
});
// Poll for agent status
const agents = await client.agents.list();
for (const agent of agents) {
console.log(`${agent.name}: ${agent.state}`);
}
// Store an artifact
await client.artifact.put({
name: 'perf-baseline',
type: 'benchmark',
content: JSON.stringify(perfResults),
});
// Read shared context
const env = await client.context.get('target_environment');Project Structure
wanman.dev/
packages/
cli/ # wanman CLI (send/recv/task/artifact/run/takeover/...)
core/ # Shared types, JSON-RPC protocol, skills (core/skills/)
host-sdk/ # Host-side SDK for embedding wanman into other tools
runtime/ # Supervisor, agent process manager, SQLite stores, adapters
docs/
quickstart.md
architecture.md
CONTRIBUTING.mdBuilt-in Shared Skills (packages/core/skills/
)
packages/core/skills/Skills are auto-discovered by agents at :
~/.claude/skills/- — Conventions for naming agent-produced artifacts.
artifact-naming - — Quality standards for artifacts.
artifact-quality - — CEO consistency checks across agent outputs.
cross-validation - — Market/data research methodology.
research-methodology - — CLI command reference consumed by agents at runtime.
wanman-cli - — File-system conventions inside agent workspaces.
workspace-conventions
Validate Skills
bash
# Check that skill docs only reference real CLI commands
wanman skill:check
wanman skill:check packages/core/skills/wanman-cli.mdTesting
bash
# Type checking
pnpm typecheck
# Run all tests
pnpm test
# Run tests with coverage (target: 90%+ line coverage)
pnpm exec vitest run \
--coverage \
--coverage.reporter=text-summary \
--coverage.reporter=json-summary \
--coverage.exclude='**/dist/**'
# Coverage summary written to: coverage/coverage-summary.jsonTroubleshooting
Supervisor Not Reachable
bash
# Check if supervisor is running on expected port
curl http://localhost:3120/rpc
# Override URL if running on a non-default port
export WANMAN_URL=http://localhost:4000
wanman agentsAgent Stuck / Not Responding
bash
# Check agent states
wanman agents
# Send a steer message to interrupt and redirect
wanman send <agent-name> --steer "Reset and await new instructions"
# Escalate to CEO for intervention
wanman escalate "Agent 'dev' appears stuck on task <task-id>, please reassign"
# Watch live activity to diagnose
wanman watchidle_cached
Lifecycle with Wrong Runtime
idle_cachedError: idle_cached lifecycle requires Claude runtime; codex has no resume mechanismFix: Only use when (or unset, as Claude is the default). Switch lifecycle to for Codex agents.
lifecycle: "idle_cached"WANMAN_RUNTIME=claudeon-demandAgents Mutating Wrong Directory
Each agent runs in its own git worktree under (default: ). If an agent appears to be modifying wrong files, check in your config and ensure is set correctly in agent subprocesses.
workspaceRoot.wanman/agents/workspaceRootWANMAN_AGENT_NAMESQLite Lock Errors
If the supervisor crashes mid-run, the SQLite file at may be locked:
dbPathbash
# Stop all wanman processes
pkill -f wanman
# Remove WAL files if present
rm .wanman/wanman.db-wal .wanman/wanman.db-shm
# Restart supervisor
wanman takeover .Skill Validation Failures
bash
# Run skill:check to find references to non-existent commands
wanman skill:check
# Output will show which skill files reference invalid commands
# Update the skill markdown to use only real wanman CLI commandsFurther Reading
- Quickstart Guide — First-run walkthrough against any git repo.
- Architecture Deep Dive — Agent lifecycle, JSON-RPC, stores, adapters, brain/persistence.
- Contributing Guide — Tests, typecheck, commit conventions.
- wanman.ai — Hosted 24/7 sandbox edition with dynamic roles and global search.