mux

mux is a command for Claude Code from wowoyong/agent-mux. It costs 13 tokens per session (1,234 once invoked), scanned A, original, MIT.

A command that chooses between the Claude and Codex command-line assistants to run a task. It can also inspect usage, show its routing decision, and handle Codex changes with confirmation options.

In plain words
What is it for?
Routing tasks to Claude or Codex, previewing routing with a dry run, checking usage, showing detailed analysis, and applying Codex results with optional confirmation.
Why use it?
It removes the need to decide manually which coding assistant should handle each task and helps account for available usage.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code; mentions Codex.

Part of the agent-mux plugin — 1 skill, 4 commands, 4 agents, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/wowoyong/agent-mux/mux
Clone the repo
git clone --depth 1 https://github.com/wowoyong/agent-mux

Made for: Claude Code.

Or install agent-mux, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 4 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mux

README.md
[![agentmods](https://agentmods.dev/badge/commands/wowoyong/agent-mux/mux.svg)](https://agentmods.dev/commands/wowoyong/agent-mux/mux)
Your own site
<a href="https://agentmods.dev/commands/wowoyong/agent-mux/mux"><img src="https://agentmods.dev/badge/commands/wowoyong/agent-mux/mux.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,234 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.01234
Opus 5 $0.00006 $0.00617
Sonnet 5 $0.00003 $0.00247
Haiku 4.5 $0.00001 $0.00123

Measured 5d ago against content hash 110425188120, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

mux scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/mux.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/mux command

Parse the user's input and execute the mux routing workflow.

Input format

/mux "task description" [--dry-run] [--verbose] [--route=claude|codex] [--auto-apply] [--confirm]

Steps

1. Parse input

Extract the task description (quoted string) and any flags from the user's input.

Available flags:

  • --dry-run: Analyze and show routing decision without executing
  • --verbose: Show detailed signal analysis
  • --route=claude|codex: Force routing to a specific CLI
  • --auto-apply: Skip confirmation for Codex results (deny-list files still require approval)
  • --confirm: Show diff before applying Codex results (default: ON)

2. Check budget

Call get_mux_status MCP tool to retrieve:

  • Current tier (budget/standard/premium/power)
  • Claude messages used and estimated total
  • Codex tasks used and estimated total
  • Budget recommendation (normal/conserve/codex_only/queue)
  • Any running tasks

If budget recommendation is codex_only, force route to Codex unless --route=claude is explicitly set. If budget recommendation is queue, warn the user that both CLIs are near capacity.

3. Analyze the task

Determine routing using the 2-Phase decision process:

Phase 1 -- Hard Rules (check in priority order):

  1. Task needs MCP tools (database queries, API calls, web fetch) -> Claude
  2. Task requires interactive dialogue or follow-up questions -> Claude
  3. Task needs previous conversation context -> Claude
  4. Task is a standalone security audit (single file/module) -> Codex
  5. Task is refactoring affecting >5 files -> Claude
  6. Task is scaffolding (project/module structure creation) -> Claude

Phase 2 -- Weighted Scoring (only if no hard rule matched):

  1. Extract keyword signals from task description using pattern matching
  2. Compute weighted score from all detected signals
  3. Apply interaction modifiers for signal combinations
  4. Factor in budget status (at Budget tier, ties go to Codex)
  5. Determine target and confidence percentage

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 125 lines · 13 tokens per session scan A 110425188120

Subscribe to this mod's changes

mux is a command published in the GitHub repository wowoyong/agent-mux (1 stars, last pushed 5mo ago), licensed MIT. It adds 13 tokens to every session and 1,234 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.