team
Original:🇺🇸 English
Translated
N coordinated agents on shared task list using tmux-based orchestration
2installs
Sourceyeachan-heo/oh-my-codex
Added on
NPX Install
npx skill4agent add yeachan-heo/oh-my-codex teamTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Team Skill
$team.omx/state/team/...omx team api ...This skill is operationally sensitive. Treat it as an operator workflow, not a generic prompt pattern.
Team vs Native Subagents
- Use Codex native subagents for bounded, in-session parallelism where one leader thread can fan out a few independent subtasks and wait for them directly.
- Use when you need durable tmux workers, shared task state, mailbox/dispatch coordination, worktrees, explicit lifecycle control, or long-running parallel execution that must survive beyond one local reasoning burst.
omx team - Native subagents can complement team/ralph execution, but they do not replace the tmux team runtime's stateful coordination contract.
What This Skill Must Do
GPT-5.4 Guidance Alignment
- Default to concise, evidence-dense progress and completion reporting unless the user or risk level requires more detail.
- Treat newer user task updates as local overrides for the active workflow branch while preserving earlier non-conflicting constraints.
- If correctness depends on additional inspection, retrieval, execution, or verification, keep using the relevant tools until the team workflow is grounded.
- Continue through clear, low-risk, reversible next steps automatically; ask only when the next step is materially branching, destructive, or preference-dependent.
When user triggers , the agent must:
$team- Invoke OMX runtime directly with
omx team ... - Avoid replacing the flow with in-process fanout
spawn_agent - Verify startup and surface concrete state/pane evidence
- Keep team state alive until workers are terminal (unless explicit abort)
- Handle cleanup and stale-pane recovery when needed
If is unavailable, stop with a hard error.
omx teamInvocation Contract
bash
omx team [N:agent-type] "<task description>"Examples:
bash
omx team 3:executor "analyze feature X and report flaws"
omx team "debug flaky integration tests"
omx team "ship end-to-end fix with verification"Team-first launch contract
omx team ...- Canonical launch: use plain /
omx team ...for coordinated workers.$team ... - Verification ownership: keep one lane focused on tests, regression coverage, and evidence before shutdown.
- Escalation: start a separate /
omx ralph ...only when a later manual follow-up still needs a persistent single-owner fix/verification loop.$ralph ... - Deprecation: has been removed. Use plain
omx team ralph ...for team execution or runomx team ...separately when you explicitly want a later Ralph loop.omx ralph ...
Claude teammates (v0.6.0+)
Important: (for example ) selects the worker role prompt, not the worker CLI ( vs ).
N:agent-type2:executorcodexclaudeTo launch Claude teammates, use the team worker CLI env vars:
bash
# Force all teammates to Claude CLI
OMX_TEAM_WORKER_CLI=claude omx team 2:executor "update docs and report"
# Mixed team (worker 1 = Codex, worker 2 = Claude)
OMX_TEAM_WORKER_CLI_MAP=codex,claude omx team 2:executor "split doc/code tasks"
# Auto mode: Claude is selected when worker launch args/model contains 'claude'
OMX_TEAM_WORKER_CLI=auto OMX_TEAM_WORKER_LAUNCH_ARGS="--model claude-..." omx team 2:executor "run mixed validation"Preconditions
Before running , confirm:
$team- installed (
tmux)tmux -V - Current leader session is inside tmux (is set)
$TMUX - command resolves to the intended install/build
omx - If running repo-local , run
node bin/omx.js ...afternpm run buildchangessrc - Check HUD pane count in the leader window and avoid duplicate panes before split
hud --watch
Suggested preflight:
bash
tmux list-panes -F '#{pane_id}\t#{pane_start_command}' | rg 'hud --watch' || trueIf duplicates exist, remove extras before to prevent HUD ending up in worker stack.
omx teamPre-context Intake Gate
Before launching , require a grounded context snapshot:
omx team- Derive a task slug from the request.
- Reuse the latest relevant snapshot in when available.
.omx/context/{slug}-*.md - If none exists, create (UTC
.omx/context/{slug}-{timestamp}.md) with:YYYYMMDDTHHMMSSZ- task statement
- desired outcome
- known facts/evidence
- constraints
- unknowns/open questions
- likely codebase touchpoints
- If ambiguity remains high, run first for brownfield facts, then run
explorebefore team launch.$deep-interview --quick <task>
Do not start worker panes until this gate is satisfied; if forced to proceed quickly, state explicit scope/risk limitations in the launch report.
For simple read-only brownfield lookups during intake, follow active session guidance: when is enabled, prefer with narrow, concrete prompts; otherwise use the richer normal explore path and fall back normally if is unavailable.
USE_OMX_EXPLORE_CMDomx exploreomx exploreFollow-up Staffing Contract
When is used as a follow-up mode from ralplan, carry forward the approved plan's explicit available-agent-types roster and convert it into concrete staffing guidance before launch:
$team- keep worker-role choices inside the known roster
- state the recommended headcount and role counts
- state the suggested reasoning level for each lane when available
- explain why each lane exists (delivery, verification, specialist support)
- include an explicit launch hint (/
omx team N "<task>") for the coordinated team run; mention a later separate Ralph follow-up only when genuinely needed$team N "<task>" - if the ideal role is unavailable, choose the closest role from the roster and say so
Current Runtime Behavior (As Implemented)
omx team- Parse args (,
N, task)agent-type - Sanitize team name from task text
- Initialize team state:
.omx/state/team/<team>/config.json.omx/state/team/<team>/manifest.v2.json.omx/state/team/<team>/tasks/task-<id>.json
- Compose team-scoped worker instructions file at:
.omx/state/team/<team>/worker-agents.md- Uses project content (if present) + worker overlay, without mutating project
AGENTS.mdAGENTS.md
- Resolve canonical shared state root from leader cwd ()
<leader-cwd>/.omx/state - Split current tmux window into worker panes
- Launch workers with:
OMX_TEAM_WORKER=<team>/worker-<n>OMX_TEAM_STATE_ROOT=<leader-cwd>/.omx/stateOMX_TEAM_LEADER_CWD=<leader-cwd>- worker CLI selected by /
OMX_TEAM_WORKER_CLI(OMX_TEAM_WORKER_CLI_MAPorcodex)claude - optional worktree metadata envs when is used
--worktree
- Wait for worker readiness (polling)
capture-pane - Write per-worker and trigger via
inbox.mdtmux send-keys - Return control to leader; follow-up uses /
status/resumeshutdown
Important:
- Leader remains in existing pane
- Worker panes are independent full Codex/Claude CLI sessions
- Workers may run in separate git worktrees () while sharing one team state root
omx team --worktree[=<name>] - Worker ACKs go to
mailbox/leader-fixed.json - Notify hook updates worker heartbeat and nudges leader during active team mode
- Submit routing uses this CLI resolution order per worker trigger:
- explicit worker CLI provided by runtime state (persisted on worker identity/config),
- entry for that worker index,
OMX_TEAM_WORKER_CLI_MAP - fallback / auto detection.
OMX_TEAM_WORKER_CLI
- Mixed CLI-map teams are supported for both startup and trigger submit behavior.
- Trigger submit differs by CLI:
- Codex may use queue-first on busy panes (strategy-dependent).
Tab - Claude always uses direct Enter-only () rounds (never queue-first
C-m).Tab
- Codex may use queue-first
Team worker model + thinking resolution (current contract)
Team mode resolves worker model flags from one shared launch-arg set (not per-worker model selection).
Model precedence (highest to lowest):
- Explicit worker model in
OMX_TEAM_WORKER_LAUNCH_ARGS - Inherited leader flag
--model - Low-complexity default from (legacy alias:
OMX_DEFAULT_SPARK_MODEL) when 1+2 are absent and teamOMX_SPARK_MODELis low-complexityagentType
Default-model rule:
- Do not assume a frontier or spark model from recency or model-family heuristics.
- Use for frontier-default guidance.
OMX_DEFAULT_FRONTIER_MODEL - Use for spark/low-complexity worker-default guidance.
OMX_DEFAULT_SPARK_MODEL
Thinking-level rule (critical):
- No model-name heuristic mapping.
- Team runtime must not infer from model-name substrings (e.g.,
model_reasoning_effort,spark,high-capability).mini - When the leader assigns teammate roles/tasks, OMX allocates per-worker reasoning effort dynamically from the resolved worker role (,
low,medium).high - Explicit launch args still win: if already includes
OMX_TEAM_WORKER_LAUNCH_ARGS, that explicit value overrides dynamic allocation for every worker.-c model_reasoning_effort=...
Normalization requirements:
- Parse both and
--model <value>--model=<value> - Remove duplicate/conflicting model flags
- Emit exactly one final canonical flag:
--model <value> - Preserve unrelated args in worker launch config
- If explicit reasoning exists, preserve canonical ; otherwise inject the worker role's default reasoning level
-c model_reasoning_effort="<level>"
Required Lifecycle (Operator Contract)
Follow this exact lifecycle when running :
$team- Start team and verify startup evidence (team line, tmux target, panes, ACK mailbox)
- Monitor task and worker progress with runtime/state tools first (,
omx team status <team>, mailbox/state files)omx team resume <team> - Wait for terminal task state before shutdown:
pending=0in_progress=0- (or explicitly acknowledged failure path)
failed=0
- Only then run
omx team shutdown <team> - Verify shutdown evidence and state cleanup
Do not run while workers are actively writing updates unless user explicitly requested abort/cancel.
Do not treat ad-hoc pane typing as primary control flow when runtime/state evidence is available.
shutdownActive leader monitoring rule
While a team is ON/running, the leader must not go blind. Keep checking live team state until terminal completion.
Minimum acceptable loop:
bash
sleep 30 && omx team status <team-name>Repeat that check while the team stays active, or use when event-driven waiting is a better fit.
omx team await <team-name> --timeout-ms 30000 --jsonIf the leader gets a stale/team-stalled nudge, immediately run before taking any manual intervention.
omx team status <team-name>Message Dispatch Policy (CLI-first, state-first)
To avoid brittle behavior, message/task delivery must not be driven by ad-hoc tmux typing.
Required default path:
- Use runtime lifecycle commands for orchestration.
omx team ... - Use for mailbox/task mutations.
omx team api ... --json - Verify delivery via mailbox/state evidence (, task status,
mailbox/*.json).omx team status
Strict rules:
- MUST NOT use direct as the primary mechanism to deliver instructions/messages.
tmux send-keys - MUST NOT spam Enter/trigger keys without first checking runtime/state evidence.
- MUST prefer durable state writes + runtime dispatch (, mailbox, inbox).
dispatch/requests.json - Direct tmux interaction is fallback-only and only after failure checks (for example ) or explicit user request (for example “press enter”).
worker_notify_failed:<worker>
Operational Commands
bash
omx team status <team-name>
omx team resume <team-name>
omx team shutdown <team-name>Semantics:
- : reads team snapshot (task counts, dead/non-reporting workers)
status - : reconnects to live team session if present
resume - : graceful shutdown request, then cleanup (deletes
shutdown).omx/state/team/<team>
Data Plane and Control Plane
Control Plane
- tmux panes/processes (per worker)
OMX_TEAM_WORKER - leader notifications via
tmux display-message
Data Plane
- files
.omx/state/team/<team>/... - Team mailbox files:
.omx/state/team/<team>/mailbox/leader-fixed.json.omx/state/team/<team>/mailbox/worker-<n>.json- (durable dispatch queue; hook-preferred, fallback-aware)
.omx/state/team/<team>/dispatch/requests.json
Key Files
.omx/state/team/<team>/config.json.omx/state/team/<team>/manifest.v2.json.omx/state/team/<team>/tasks/task-<id>.json.omx/state/team/<team>/workers/worker-<n>/identity.json.omx/state/team/<team>/workers/worker-<n>/inbox.md.omx/state/team/<team>/workers/worker-<n>/heartbeat.json.omx/state/team/<team>/workers/worker-<n>/status.json.omx/state/team-leader-nudge.json
Team Mutation Interop (CLI-first)
Use for machine-readable mutation/reads instead of legacy MCP tools.
omx team apiteam_*bash
omx team api <operation> --input '{"team_name":"my-team",...}' --jsonExamples:
bash
omx team api send-message --input '{"team_name":"my-team","from_worker":"worker-1","to_worker":"leader-fixed","body":"ACK"}' --json
omx team api claim-task --input '{"team_name":"my-team","task_id":"1","worker":"worker-1"}' --json
omx team api transition-task-status --input '{"team_name":"my-team","task_id":"1","from":"in_progress","to":"completed","claim_token":"<token>"}' --json--jsonschema_versiontimestampcommandokoperation- or
dataerror
Team + Worker Protocol Notes
Leader-to-worker:
- Write full assignment to worker
inbox.md - Send short trigger (<200 chars) with
tmux send-keys
Worker-to-leader:
- Send ACK to mailbox via
leader-fixedomx team api send-message --json - Claim/transition/release task lifecycle via
omx team api <operation> --json
Worker commit protocol (critical for incremental integration):
- After completing task work and before reporting completion, workers MUST commit:
git add -A && git commit -m "task: <task-subject>" - This ensures changes are available for incremental integration into the leader branch
- If a worker forgets to commit, the runtime auto-commits as a fallback, but explicit commits are preferred
Task ID rule (critical):
- File path uses (example
task-<id>.json)task-1.json - MCP API uses bare id (example
task_id, not"1")"task-1" - Never instruct workers to read
tasks/{id}.json
Environment Knobs
Useful runtime env vars:
OMX_TEAM_READY_TIMEOUT_MS- Worker readiness timeout (default 45000)
OMX_TEAM_SKIP_READY_WAIT=1- Skip readiness wait (debug only)
OMX_TEAM_AUTO_TRUST=0- Disable auto-advance for trust prompt (default behavior auto-advances)
OMX_TEAM_AUTO_ACCEPT_BYPASS=0- Disable Claude bypass-permissions prompt auto-accept (default behavior auto-accepts + Enter)
2
- Disable Claude bypass-permissions prompt auto-accept (default behavior auto-accepts
OMX_TEAM_WORKER_LAUNCH_ARGS- Extra args passed to worker launch command
OMX_TEAM_WORKER_CLI- Worker CLI selector: (default:
auto|codex|claude)auto - chooses
autowhen workerclaudecontains--model, otherwiseclaudecodex - In mode, workers launch with exactly one
claudeand ignore explicit model/config/effort launch overrides (uses default--dangerously-skip-permissions)settings.json
- Worker CLI selector:
OMX_TEAM_WORKER_CLI_MAP- Per-worker CLI selector (comma-separated )
auto|codex|claude - Length must be (broadcast) or exactly the team worker count
1 - Example:
OMX_TEAM_WORKER_CLI_MAP=codex,codex,claude,claude - When present, overrides
OMX_TEAM_WORKER_CLI
- Per-worker CLI selector (comma-separated
OMX_TEAM_AUTO_INTERRUPT_RETRY- Trigger submit fallback (default: enabled)
- disables adaptive queue->resend escalation
0
OMX_TEAM_LEADER_NUDGE_MS- Leader nudge interval in ms (default 120000)
OMX_TEAM_STRICT_SUBMIT=1- Force strict send-keys submit failure behavior
Failure Modes and Diagnosis
Operator note (important for Claude panes):
- Manual Enter injection () can appear to "do nothing" when a worker is actively processing; Enter may be queued by the pane/task flow.
tmux send-keys ... C-m - This is not necessarily a runtime bug. Confirm worker/team state before diagnosing dispatch failure.
- Avoid repeated blind Enter spam; it can create noisy duplicate submits once the pane becomes idle.
Safe Manual Intervention (last resort)
Use only after checking and mailbox/state evidence:
omx team status <team>- Capture pane tail to confirm current worker state:
tmux capture-pane -t %<worker-pane> -p -S -120- If a larger-tail read or bounded summary would help, prefer explicit opt-in inspection via before improvising extra tmux commands.
omx sparkshell --tmux-pane %<worker-pane> --tail-lines 400
- If the pane is stuck in an interactive state, safely return to idle prompt first:
- optional interrupt or escape flow (CLI-specific) once, then re-check pane capture
C-c
- optional interrupt
- Send one concise trigger (single line) and wait for evidence:
tmux send-keys -t %<worker-pane> "ack + continue current task; report status" C-m
- Re-check:
- pane output via
capture-pane - mailbox updates (or worker mailbox)
mailbox/leader-fixed.json omx team status <team>
- pane output via
worker_notify_failed:<worker>
worker_notify_failed:<worker>Meaning:
- Leader wrote inbox but trigger submit path failed
Checks:
tmux list-panes -F '#{pane_id}\t#{pane_start_command}'tmux capture-pane -t %<worker-pane> -p -S -120- Verify worker process alive and not stuck on trust prompt
- Rebuild if running repo-local ()
npm run build
Team starts but leader gets no ACK
Checks:
- Worker pane capture shows inbox processing
- exists
.omx/state/team/<team>/mailbox/leader-fixed.json - Worker skill loaded and called
omx team api send-message --json - Task-id mismatch not blocking worker flow
Worker logs omx team api ... ENOENT
(or legacy team_send_message ENOENT
/ team_update_task ENOENT
)
omx team api ... ENOENTteam_send_message ENOENTteam_update_task ENOENTMeaning:
- Team state path no longer exists while worker is still running.
- Typical cause: leader/manual flow ran (or removed
omx team shutdown <team>) before worker finished..omx/state/team/<team>
Checks:
- and confirm whether tasks were still
omx team status <team>when shutdown occurredin_progress - Verify whether exists
.omx/state/team/<team>/ - Inspect worker pane tail for post-shutdown writes
- Confirm no external cleanup () happened during execution
rm -rf .omx/state/team/<team>
Prevention:
- Enforce completion gate (no in-progress tasks) before shutdown
- Use only for terminal completion or explicit abort
shutdown - If aborting, expect late worker writes to fail and treat ENOENT as expected teardown artifact
Shutdown reports success but stale worker panes remain
Cause:
- stale pane outside config tracking or previous failed run
Fix:
- manual pane cleanup (see clean-slate commands)
Clean-Slate Recovery
Run from leader pane:
bash
# 1) Inspect panes
tmux list-panes -F '#{pane_id}\t#{pane_current_command}\t#{pane_start_command}'
# 2) Kill stale worker panes only (examples)
tmux kill-pane -t %450
tmux kill-pane -t %451
# 3) Remove stale team state (example)
rm -rf .omx/state/team/<team-name>
# 4) Retry
omx team 1:executor "fresh retry"Guidelines:
- Do not kill leader pane
- Do not kill HUD pane () unless intentionally restarting HUD
omx hud --watch
Required Reporting During Execution
When operating this skill, provide concrete progress evidence:
- Team started line ()
Team started: <name> - tmux target and worker pane presence
- leader mailbox ACK path/content check
- status/shutdown outcomes
Do not claim success without file/pane evidence.
Do not claim clean completion if shutdown occurred with .
Use as an explicit opt-in operator aid for pane inspection and summaries; keep raw evidence available for manual intervention and proof.
in_progress>0omx sparkshell --tmux-pane ...tmux capture-paneMCP Job Lifecycle Tools
For programmatic or agent-driven team spawning (as opposed to interactive CLI use), OMX exposes four MCP tools via the :
team-server| Tool | Description |
|---|---|
| Spawn tmux CLI workers in the background; returns a |
| Non-blocking status check for a running job |
| Block until the job completes, with automatic idle-pane nudging |
| Kill worker tmux panes for a job (early stop only) |
CLI vs MCP Tools
- CLI — Primary method for interactive team orchestration. Use this when you are operating inside a live tmux session and want direct pane visibility.
omx team ... - MCP tools — For programmatic or agent-driven team spawning (analogous to OMC's
omx_run_team_*tools). Use these when an agent needs to launch workers, poll status, and collect results without manual intervention.omc_run_team_*
Naming Distinction
Two cleanup tools exist and must not be confused:
- (state-server): Deletes team state files on disk (
team_cleanup). Use after a team run is fully complete..omx/state/team/<team>/ - (team-server): Kills tmux worker panes for a job. Use only when stopping workers early; otherwise
omx_run_team_cleanuphandles natural termination.omx_run_team_wait
Basic Usage Example
1. omx_run_team_start({
teamName: "fix-bugs",
agentTypes: ["codex"],
tasks: [{ subject: "Fix bug", description: "..." }],
cwd: "/path/to/project"
})
→ Returns { jobId: "omx-abc123" }
2. omx_run_team_wait({ job_id: "omx-abc123", timeout_ms: 300000 })
→ Blocks until done, auto-nudges idle panes
3. omx_run_team_cleanup({ job_id: "omx-abc123" })
→ Only needed if stopping workers earlyomx_run_team_statusLimitations
- Worktree provisioning requires a git repository and can fail on branch/path collisions
- send-keys interactions can be timing-sensitive under load
- stale panes from prior runs can interfere until manually cleaned
Scenario Examples
Good: The user says after the workflow already has a clear next step. Continue the current branch of work instead of restarting or re-asking the same question.
continueGood: The user changes only the output shape or downstream delivery step (for example ). Preserve earlier non-conflicting workflow constraints and apply the update locally.
make a PRBad: The user says , and the workflow restarts discovery or stops before the missing verification/evidence is gathered.
continue