Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use acpx as a headless ACP CLI for agent-to-agent communication, always inside an isolated SubAgent. Use when running coding agents through acpx, managing persistent ACP sessions, queueing prompts, consuming structured agent output from scripts, comparing the same prompt across multiple agents, or composing multi-agent workflows with defineFlow/decision/decisionEdge. Never invoke the claude adapter (nested-instance blacklist).
.claude/skills/fradser-acpx/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 292% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 33% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 325% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 154% | 0% |
acpx is a headless, scriptable CLI client for the Agent Client Protocol (ACP). It is built for agent-to-agent communication over the command line and avoids PTY scraping.
Core capabilities:
exec)compare)-s/--session)sessions ensure)sessions prune with age filters and history cleanup)--no-wait)cancel) for in-flight turnssession/cancel on interruptset-mode, set <key> <value>)--fileconfig show|init--mcp-config)sessions show, sessions history)statusauthenticate handshake via env/config credentialstext, json, quiet) with optional --suppress-reads--agent escape hatch--system-prompt / --append-system-prompt--no-terminal for review-only flows--no-fs for agent-native file operations--allowed-tools), turn cap (--max-turns), retry on transient failures (--prompt-retries)acpx flow run and the acpx/flows authoring API (defineFlow, decision, decisionEdge, acp, action, compute, checkpoint)bashnpm i -g acpx
For normal session reuse, prefer a global install over npx.
CRITICAL: when this skill is loaded inside Claude Code, the following protocol governs every invocation. These rules override any upstream default or example in this document.
Every acpx-driven task MUST execute inside an isolated SubAgent launched for that task (e.g. via the Task/Agent tool), with its own fresh context. Do not run acpx work inline in the main conversation thread. Rationale: agent-to-agent calls are long, noisy, and token-heavy; isolating them keeps the parent context clean and lets the SubAgent return only the distilled result.
claude adapterThe claude built-in is blacklisted (see the registry rule below). Calling acpx claude ... spawns a nested Claude instance — forbidden. Route to a non-Claude agent instead.
For each user request, follow this order inside the SubAgent:
bash acpx --help # lists built-in agent names command -v codex gemini cursor copilot 2>/dev/null # which CLIs are on PATH
Pick the first installed non-Claude agent that fits the task (codex is the default; fall back through gemini, qwen, cursor, copilot, droid, opencode, ...). Do not assume an agent is installed — verify, then use it.
prompt for multi-turn, exec for one-shot, compare for cross-agent).acpx skill/reference material already documents the capability needed (e.g. session lifecycle, flow authoring, output formats, permission policies in references/). If it does, defer to that knowledge and run the documented command — do not re-derive or re-explain it. Only synthesize new steps when the request is not already covered upstream.The SubAgent returns a short summary of what ran, which agent it used, and the distilled result — not the raw ACP stream.
CRITICAL: never accept an acpx SubAgent's result as final. Whatever the acpx SubAgent returns — a review, an evaluation, a diff, a recommendation, or a "done" — is a proposal from an outside agent, not a verdict. Before acting on it, spawn a SECOND, independent, blank SubAgent and have it reflect on that result; only after the reflection returns do you decide the next step.
acpx ... review, the blank SubAgent critiques the review itself — which findings are real, which are noise, what it missed — and that critique, not the raw review, decides what you do next.This is the same GAN-evaluator / independent-audit pattern used elsewhere in this project: the agent that produces a result is never the agent that judges it.
prompt is the default verb.
bashacpx [global_options] [prompt_text...] acpx [global_options] prompt [prompt_options] [prompt_text...] acpx [global_options] exec [prompt_options] [prompt_text...] acpx [global_options] compare <agent>... '<prompt_text>' acpx [global_options] compare <agent>... --file <path> acpx [global_options] cancel [-s <name>] acpx [global_options] set-mode <mode> [-s <name>] acpx [global_options] set <key> <value> [-s <name>] acpx [global_options] status [-s <name>] acpx [global_options] sessions [list | new [--name <name>] | ensure [--name <name>] | close [name] | show [name] | history [name] [--limit <count>] | export [name] --output <path> | import <archive> [--name <name>] [--cwd <dir>] | prune [--dry-run] [--before <date> | --older-than <days>] [--include-history]] acpx [global_options] config [show | init] acpx [global_options] flow run <file> [--input-json '<json>' | --input-file <path>] [--default-agent <name>]
If prompt text is omitted and stdin is piped, acpx reads prompt text from stdin.
Friendly agent names resolve to commands:
pi -> npx pi-acp@^0.0.31openclaw -> openclaw acpcodex -> npx -y @agentclientprotocol/codex-acp@^1.1.5claude -> npx -y @agentclientprotocol/claude-agent-acp@^0.60.0gemini -> gemini --acpcursor -> cursor-agent acpcopilot -> copilot --acp --stdiodroid -> droid exec --output-format acpfast-agent -> uvx fast-agent-mcp acpgrok-build -> grok agent stdioiflow -> iflow --experimental-acpkilocode -> npx -y @kilocode/cli acpkimi -> kimi acpkiro -> kiro-cli-chat acpmux -> npx -y mux@^0.28.0 acpopencode -> npx -y opencode-ai acppool -> pool acpqoder -> qodercli --acpqwen -> qwen --acptrae -> traecli acp servezeroclaw -> zeroclaw acpRules:
codex for top-level prompt, exec, compare, and sessions.factory-droid and factorydroid also resolve to the built-in droid adapter.grok-build authenticates through the installed grok CLI: its agent-managed cached login when the server advertises cached_token, or XAI_API_KEY when it advertises xai.api_key.--agent <command> explicitly sets a raw ACP adapter command.--agent in the same command.claude adapter. This skill runs inside Claude Code, so acpx claude would spawn a nested Claude instance — redundant, slower, and it adds no model diversity. Prefer codex (default), gemini, qwen, or another non-Claude agent. Only call claude if the user explicitly requests a second Claude instance by name.bashacpx codex 'fix flaky tests' acpx codex prompt 'fix flaky tests' acpx prompt 'fix flaky tests' # defaults to codex
NO_SESSION and prompts for sessions newsession/cancel before force-kill fallbackPrompt options: -s, --session <name>, --no-wait, -f, --file <path>
bashacpx exec 'summarize this repo' acpx codex exec 'summarize this repo'
Runs a single prompt in a temporary ACP session. Does not reuse or save persistent session state.
bashacpx compare codex gemini qwen 'summarize this repo in 3 lines' acpx compare codex gemini --file ./prompt.md acpx compare codex gemini -- '--looks-like-a-flag'
Runs the same prompt across multiple agents, each in a temporary exec-style session. Honors the same global execution controls as exec (--cwd, --timeout, permission flags, --policy, auth, terminal advertising, retries, model/system options, --format).
-- after the agent list when prompt words might be parsed as flags (see the third example).--format text prints one summary-table row per agent (timing, token usage, stop reason, permissions, final output)--format json or command-local --json prints a CompareRow[] summary payload--format quiet prints <agent>\t<status> per rowCompareRow.status is ok, cancelled, permission_denied, or errorbashacpx codex cancel acpx codex set-mode auto acpx codex set model gpt-5.2[high] acpx codex set model gpt-5.4
cancel: sends cooperative session/cancel through queue-owner IPCset-mode: calls ACP session/set_modeset: calls ACP session/set_config_optionset model <id>: calls session/set_model for mid-session model switchingbashacpx sessions list # list all sessions acpx sessions new --name backend # create fresh session acpx sessions ensure --name backend # idempotent: get or create acpx sessions close backend # close a session acpx sessions show backend # show metadata acpx sessions history backend --limit 20 # show turn history acpx sessions export backend --output backend-session.json acpx sessions import backend-session.json --name backend-restored acpx sessions prune --dry-run --older-than 7 acpx sessions prune --older-than 30 --include-history acpx status # check local agent process
Prefix any command with an agent name: acpx codex sessions ensure --name backend
--agent <command>: raw ACP agent command (escape hatch)--cwd <dir>: working directory for session scope (default: current directory)--mcp-config <path>: load mcpServers from an external JSON file for the invocation, replacing project/global MCP config. Relative paths resolve from --cwd. A live persistent session rejects MCP config changes until it is closed.--approve-all: auto-approve all permission requests--approve-reads: auto-approve reads/searches, prompt for writes (default mode)--deny-all: deny all permission requests--non-interactive-permissions <policy>: when prompting is unavailable, choose deny or fail--permission-policy <json-or-file> / --policy: per-tool ACP permission rules--format <fmt>: output format (text, json, quiet)--json-strict: strict JSON mode; requires --format json and suppresses non-JSON stderr output--suppress-reads: suppress raw read-file contents while preserving the selected format--timeout <seconds>: max wait time (positive number)--ttl <seconds>: queue owner idle TTL before shutdown (default 300, 0 disables TTL)--model <id>: request an agent model during session creation--system-prompt <text>: replace the agent system prompt (persisted in session)--append-system-prompt <text>: append text to the agent system prompt--allowed-tools <list>: comma-separated tool whitelist (use "" for no tools)--max-turns <count>: cap session turn count--prompt-retries <count>: retry failed prompt turns on transient errors (default 0)--no-fs: advertise ACP filesystem read/write capabilities as disabled so compatible agents use their native filesystem implementation--no-terminal: do not advertise the ACP terminal capability--verbose: verbose ACP/debug logs to stderrPermission flags are mutually exclusive.
Note: per the agent-registry rule above, the claude adapter is blocked from normal use. The override mechanism itself is only honored by the Claude adapter, so the examples below show the Claude form for reference. Only use them when the user explicitly asks for a nested Claude instance.
bash# Replace the system prompt for a named session, persisted across reuse acpx --system-prompt "You are a code reviewer who challenges every implicit assumption." claude -s review # Append a guideline on top of the default system prompt acpx --append-system-prompt "Always explain trade-offs before recommending a fix." claude -s impl
The override is forwarded via ACP _meta.systemPrompt on session/new and stored in session_options.system_prompt. Subsequent prompt/ensure calls in the same scope keep the override unless you explicitly create a new session. Non-Claude adapters ignore the field.
Config files are merged in this order (later wins):
~/.acpx/config.json<cwd>/.acpxrc.jsonSupported keys: defaultAgent, defaultPermissions, nonInteractivePermissions, authPolicy, ttl, timeout, format, agents map, auth map.
Use acpx config show to inspect the resolved config and acpx config init to create the global template.
Custom agents on Windows: define structured agents.<name>.argv (command plus arguments array). Unambiguous legacy command + args entries migrate automatically; raw or ambiguous commands and .sh wrappers must move to argv (with explicit migration guidance), and saved custom-agent sessions without argv must be recreated.
For ACP authenticate handshakes, use either config auth entries or explicit ACPX_AUTH_<METHOD_ID> environment variables such as ACPX_AUTH_OPENAI_API_KEY. Ambient provider env vars like OPENAI_API_KEY pass through to child agents but do not trigger ACP auth-method selection on their own.
ACPX_CLAUDE_INCLUDE_USER_SETTINGS=1: opt in to loading Claude Code user settings for built-in claude sessions. By default only project/local settings load, so globally enabled channel or daemon plugins cannot interfere with spawned ACP sessions.ACPX_AUTH_<METHOD_ID>: explicit credential for an ACP authenticate method.~/.acpx/sessions); child processes inherit the current environment by default.Persistent prompt sessions are scoped by: agentCommand, absolute cwd, optional session name.
~/.acpx/sessions/*.json-s/--session creates parallel named conversations in the same repo--cwd changes scope and therefore session lookupclosed: true and closedAt until prunedacpx creates a fresh session and updates the saved record--no-waitQueueing is per persistent session. The active acpx process for a running prompt becomes the queue owner. Other invocations submit prompts over local IPC.
--no-wait: enqueue and return after queue acknowledgementCtrl+C during an active turn sends ACP session/cancel, waits briefly, then force-kills only if cancellation does not finish in timecancel sends the same cooperative cancellation without requiring terminal signals--ttl)Use --format <fmt>:
text (default): human-readable stream with updates/tool status and done linejson: NDJSON event stream (good for automation)quiet: final assistant text only--suppress-reads: replace raw read-file contents with [read output suppressed]--json-strict: pair with --format json to suppress non-JSON stderr noiseExample automation:
bashacpx --format json codex exec 'review changed files' \ | jq -r 'select(.type=="tool_call") | [.status, .title] | @tsv'
Flows let you declare a multi-agent workflow as a graph of typed nodes connected by edges, executed by the acpx runtime. The runtime owns persistence, retries, timeouts, and routing — the flow file declares the shape, not the engine.
bashacpx flow run ./my-flow.flow.ts --input-file ./flow-input.json acpx flow run ./my-flow.flow.ts --input-json '{"task":"FIX: add a regression test"}' acpx --approve-all flow run examples/flows/pr-triage/pr-triage.flow.ts \ --input-json '{"repo":"openclaw/acpx","prNumber":150}' acpx flow run ./my-flow.flow.ts --default-agent codex
Run artifacts persist under ~/.acpx/flows/runs/<runId>/. Default per-step timeout is 15 minutes when --timeout is unset.
The authoring surface lives in acpx/flows. Node types: acp (model-driven step), decision (constrained-choice LLM step), action (runtime-supervised deterministic operation), compute (pure local data transform), checkpoint (pause point for human or external trigger).
See references/advanced.md for the full authoring example, edge shapes, and detailed node type reference, plus the full Practical workflows example set (persistent assistant, named streams, specialized reviewer, idempotent bootstrap, --no-wait follow-up, one-shot exec, cross-agent compare, --mcp-config, JSON orchestration, raw adapter, periodic cleanup, triage flow, repo-scoped review).
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | pass→pass | 16,810 | 3,734 | -78% | 1 | 1 | 0% | 2,692 | 5,472 | +103% | 0 | 0 | — |
case-10 | pass→pass | 18,437 | 3,092 | -83% | 1 | 1 | 0% | 3,146 | 5,407 | +72% | 0 | 0 | — |
case-11 | fail→pass | 35,499 | 2,542 | -93% | 1 | 1 | 0% | 5,582 | 5,330 | -5% | 0 | 0 | — |
case-01 | fail→fail | 11,408 | 18,760 | +64% | 1 | 1 | 0% | 1,774 | 6,217 | +250% | 0 | 0 | — |
case-02 | fail→fail | 4,917 | 18,686 | +280% | 1 | 1 | 0% | 735 | 5,942 | +708% | 0 | 0 | — |
case-03 | fail→fail | 10,198 | 11,683 | +15% | 1 | 1 | 0% | 1,659 | 5,871 | +254% | 0 | 0 | — |
case-04 | pass→pass | 8,509 | 5,715 | -33% | 1 | 1 | 0% | 1,478 | 6,019 | +307% | 0 | 0 | — |
case-05 | pass→fail | 13,010 | 19,424 | +49% | 1 | 1 | 0% | 2,141 | 7,548 | +253% | 0 | 0 | — |
case-06 | pass→fail | 18,582 | 14,682 | -21% | 1 | 1 | 0% | 3,326 | 5,831 | +75% | 0 | 0 | — |
case-07 | fail→pass | 9,471 | 6,544 | -31% | 1 | 1 | 0% | 1,556 | 6,102 | +292% | 0 | 0 | — |
case-08 | fail→pass | 25,487 | 4,305 | -83% | 1 | 1 | 0% | 4,234 | 5,615 | +33% | 0 | 0 | — |
case-09 | fail→pass | 8,736 | 5,126 | -41% | 1 | 1 | 0% | 1,371 | 5,826 | +325% | 0 | 0 | — |
case-13 | pass→pass | 10,146 | 2,206 | -78% | 1 | 1 | 0% | 1,711 | 5,281 | +209% | 0 | 0 | — |
case-14 | fail→pass | 13,855 | 5,061 | -63% | 1 | 1 | 0% | 2,289 | 5,818 | +154% | 0 | 0 | — |
case-15 | pass→pass | 8,181 | 2,967 | -64% | 1 | 1 | 0% | 1,230 | 5,439 | +342% | 0 | 0 | — |
case-16 | fail→pass | 13,114 | 4,758 | -64% | 1 | 1 | 0% | 2,060 | 5,811 | +182% | 0 | 0 | — |
case-17 | fail→pass | 12,838 | 6,558 | -49% | 1 | 1 | 0% | 2,274 | 6,233 | +174% | 0 | 0 | — |
case-18 | fail→pass | 40,845 | 3,987 | -90% | 1 | 1 | 0% | 8,234 | 5,791 | -30% | 0 | 0 | — |
case-19 | pass→pass | 10,052 | 5,361 | -47% | 1 | 1 | 0% | 1,653 | 5,925 | +258% | 0 | 0 | — |
case-20 | fail→pass | 8,303 | 6,678 | -20% | 1 | 1 | 0% | 1,192 | 5,834 | +389% | 0 | 0 | — |
case-21 | fail→pass | 10,080 | 5,202 | -48% | 1 | 1 | 0% | 1,652 | 5,707 | +245% | 0 | 0 | — |
case-22 | fail→pass | 11,934 | 3,060 | -74% | 1 | 1 | 0% | 1,860 | 5,437 | +192% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 18 counted toward the lift figure. The other 4 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +41 percentage points is the difference between those two pass rates over the 18 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.