/cli-subagents:cli-subagentsfrom cli-subagents
Runs subagents via CLI tools (csa) in Claude Code, Codex, Antigravity, or OpenCode. Use for delegating tasks, parallel work, or independent review.
Ships in cli-subagents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
These tools are your subagent tool. Use them the way you would use a built-in "spawn a subagent" tool: hand over a self-contained task, keep working, collect the result, check it. Each subagent runs in Claude Code, Codex, Antigravity or OpenCode with the parent's MCP servers and instructions. Same-CLI accounts also share its plugins, skills and settings. Choosing a pooled account and switching at a quota limit happen on their own. OpenCode uses the user's one profile and does not rotate accounts after a free-model limit.
Every job runs the same way, for every model and tier: you (the manager) start it, keep a heartbeat on it, peek at it, message it and collect its result yourself, with no relay in between.
In Claude Code, or any host whose shell runs commands in the background:
Write the complete task to a file (your scratchpad), then start the job and its heartbeat in one Bash call with run_in_background: true:
csa run --watch --runtime codex --model gpt-6.2-sol --effort high --access edit --cwd <project> --prompt-file <task file>
The first output line is [csa] started job <JOB>; read the output file once for JOB. The command makes no model calls and stays quiet: one neutral line every 5 minutes (--every 0 for none). You are told when it exits: the job finished, failed, was cancelled, or asks you a question. Its last lines give the outcome, the question or the start of the result, and the exact command to run next. Start independent jobs one after another, one background command each, then keep working.
Check on it whenever you like with csa peek <JOB>. It only reads: state, whether the runner and worker still run, model and account, elapsed time, current step, the last tool calls with short results, files edited, open questions, the last message (--no-text leaves the worker's words out) and the path of the full event log.
Talk to it directly, in the background: csa message <JOB> --watch "<text>" sends a follow-up and waits again; add --reply-to <ID> to answer a question. Long text goes in a file: --text-file PATH. csa cancel <JOB> stops it, csa result <JOB> prints the whole result.
Check the work before relying on it: read the diff, run the tests, confirm the files exist.
Options: --runtime (claude by default, codex, antigravity, opencode), --model, --effort, --access read|edit (full only when the user asked), --account NAME only when needed, --timeout SECONDS (default 1800), --override "<user's words>" under the Limits rule below. In a -p run, background commands stop after 30 minutes: add --max-wait 1700 and run csa watch <JOB> again after its STILL RUNNING line. Don't run csa follow yourself; it is for viewers.
The four agent types are viewers: each mirrors one running job's progress in the app's agent list, so the user can open it and read along. Start one only for jobs at reasoning effort high or above (Opus, Sol, Neon or Fable at high, xhigh or max), never for DeepSeek and never for medium or low jobs: those get only the heartbeat. Start it after the job, in the background:
Agent tool:
subagent_type: cli-subagents:cli-subagents-codex
description: Sol 6.2 high · edit · fix the login test
run_in_background: true
prompt: view=20261201-101500-a1b2c3
| Job runs in | subagent_type |
|---|---|
| Codex | cli-subagents:cli-subagents-codex |
| Antigravity (Gemini) | cli-subagents:cli-subagents-antigravity |
| OpenCode v2 | cli-subagents:cli-subagents-opencode |
| Claude Code on another account | cli-subagents:cli-subagents-claude |
A viewer never starts, messages, answers or cancels a job, and you never route anything through it: questions and the result reach you from your heartbeat, and the viewer finishes with the status line only. If it dies, nothing is lost; start another one if the user wants it.
A job that stopped before it finished (usage limit, cancel, timeout, error, or lost because the PC, the app or its runner died) keeps its worker conversation. Always continue it, like resuming a native subagent; never start a new job for the same work. A new job re-reads everything the old one already read and spends the quota twice.
csa peek <JOB> (subagent_peek elsewhere). Its verdict line says whether the job, or the newest job of its continuation chain, still runs. Antigravity workers often keep running after a restart of the PC or the app. A job that still runs is watched (csa watch <JOB> in the background) or messaged, never resumed; csa refuses to resume it.csa message <JOB> --watch "The usage limit reset. Continue where you stopped." in the background (subagent_message elsewhere). It continues the conversation as a new job and watches that one.csa jobs --resumable (subagent_list with resumable_only: true): stopped jobs nobody continued yet, with their task. Continue the newest job of a chain (continued_by names the next one).A continuation keeps the original job's override, so work the user already authorized beyond the caps goes on without asking again. A follow-up can carry a new one under the Limits rule: override on subagent_message or --override on csa message. Without an override, a continuation that only meets a full cap waits for a free slot instead of being refused. A cooldown, the usage ceiling or a budget can still refuse it; then continue it later the same way. Only a job that never started its worker has nothing to continue; start that one again.
In Codex and Antigravity, csa setup installs the same viewers as native agents; see the Codex note and the Antigravity note.
Use these where you can't run a background shell command (Codex and Antigravity hosts, other MCP clients), or when csa isn't on your PATH.
subagent_start with a complete task (prompt), the project folder (cwd, absolute) and access (read for analysis and review, edit for changes). Claude workers on read get read-only tools (file reading, search, web) plus shell commands with read-only options, including git diff; a worker hook rejects writes, execution helpers and named secret paths. Start several jobs before waiting if the work is independent.subagent_wait with the job IDs. It returns when a job finishes or a subagent sends a message or question. Call it again for the jobs still running.subagent_peek shows the same read-only snapshot as csa peek. Peek before you continue a stopped job.open_questions, reply with subagent_message and reply_to set to the question id. To give a running subagent new instructions, send subagent_message without reply_to. In Claude Code a hook also wakes an idle session when a job finishes or asks something, so you can end your turn after starting jobs.outcome and result. success means the subagent finished. Collecting a result claims it and suppresses later automatic notifications. Explicit subagent_result or csa result calls can return it again. Still read the diff, run the tests and confirm the files exist before relying on it.subagent_message to a finished or stopped job continues the same conversation as a new job. Do this instead of starting a new job for the same work; see Continuing a stopped job.The subagent can't see this conversation. State the goal, the files or folders involved, what it must not touch, decisions already made, how to verify the result, and what to report back. Point to files instead of pasting them.
Optional arguments: runtime (claude by default, codex, antigravity, opencode) when a specific agent or a second opinion from another vendor helps; model; effort; max_turns; timeout_seconds (default 1800); resume_job to continue an earlier job's conversation; account to pin one account; add_dirs. Turn-limit support depends on the runtime.
access: "full" skips the CLI's own permission checks. Use it only when the user asked for that.
Codex and Antigravity workers have their own web search and page reading, which reach sites such as Reddit that block other tools, so they suit web research. Antigravity workers find YouTube videos and read their title and description, but can't watch them or read transcripts.
Use opencode for personal projects when the user wants OpenCode or a free model and their vendor rules allow it. csa discovers OpenCode v2 (@opencode/cli) when opencode is on PATH. A missing binary adds no setup task; [opencode] enabled = false disables it. OpenCode is a worker only, not a supported host.
Omit model to keep the user's OpenCode model. When none is configured, csa uses opencode/deepseek-v4.1-flash-free. An unavailable model fails the job; csa never lets OpenCode fall back to another model. effort becomes the model's variant (low, high or max on the default model); an effort the model lacks fails with a clear message. Free models are for personal projects only. The provider says DeepSeek does not train on your data, but Anomaly's unpaid-content terms still apply. Big Pickle, MiMo and Flint may use collected data and the Nemotron endpoints log it; csa never defaults to them and blocks them unless the user chose that model. Free limits are per IP per day and reset at UTC midnight. On provider.free-limit, stop without account rotation; wait for the reset or follow the user's fallback rules.
On supported Windows, OpenCode edit workers' shell commands run in fresh MXC containers (workspace writes, protected git/agent settings, no Git Bash). Fixed-rule builds/tests have no internet egress, with host loopback allowed; reviewed commands get egress. OpenCode, its file tools, the gate and reviewer chain stay on the host with normal state and logins. File tools rely on gate paths. read allows workspace reads/list/search and no commands, so its file reads have no OS containment. edit adds workspace edits and ordinary read-only commands. The default reviewers are Claude Haiku at medium effort, then GPT-6 Luna at medium effort on codex-2, then GPT-6 Luna at medium effort on the primary Codex account; configure [review] or [[opencode.reviewers]]. Reviewers off or unable to decide means denial. Both levels deny Code Mode execute, subagents and MCP servers other than csa-parent, send web fetch/search to review and ignore project OpenCode config. full uses --auto without gate or sandbox and requires the user's explicit request. See OpenCode and Sandbox, including Fence for macOS/Linux.
Limits are enforced by csa. If a start is refused, follow the suggestion in the message; don't count quotas yourself.
Accounts marked explicit_only require an explicit account; automatic selection and failover skip them. All account spend caps apply together, including rolling windows, and cannot be bypassed with override; a budget outcome stops without retry or failover, so follow its message or wait for room under every cap.
Never set override on your own judgment; use it only when the user asked for more jobs in this conversation, or confirmed after you warned them and told them how much of the 5-hour window is left. Use csa's reported usage and reset time; if the window is unknown, say so. Otherwise ask the user or use the home model.
Put the user's own words in override, for example --override "user asked for 6 Codex agents" on csa run or csa start, or the override field on subagent_start. Empty values are rejected. This bypasses only csa's job caps, quota steps, usage ceiling, pool budgets and queueing. Account and pool cooldowns after real usage-limit errors, models, max_effort, login, depth and access still apply. Override jobs count toward later starts. The text is stored and shown in job lists, follow headers and status/result summaries. A new start needs its own override. A continuation of a stopped job keeps the original job's override unless its follow-up gives a new one.
| outcome | What to do |
|---|---|
success | Check the work |
usage_limit | The selected account hit a limit. Unpinned jobs try other accounts when failover is enabled. OpenCode free limits never rotate accounts; check the UTC reset time. Continue the job after the reset. |
no_account | All accounts are busy or cooling down; continue the job later, or tell the user |
auth | For an extra account, ask the user to run csa accounts login <name>; add --runtime codex or --runtime antigravity for non-Claude accounts. For a primary login, use the vendor CLI (claude auth login, codex login, agy or opencode auth login). OpenCode has no extra account folders in this version. |
timeout, max_turns | Narrow the task or raise the limit |
error, lost | Read message and warnings. lost means the runner died (the PC was switched off, or a crash); the job keeps its conversation. Continue the job once at most instead of starting it again. model at capacity after N retries means csa already waited and retried, and the model stayed overloaded. Fall back as your delegation rules say; do not manage another retry timer. |
Read the note for the CLI you are running in once: Claude Code, Codex or Antigravity. It covers how waiting works there and where to put new skills, MCP servers and instructions so every subagent shares them.
csa run --watch and csa message --watch as background commands; Claude Code tells you when each exits.subagent_wait again until the jobs finish.Subagents in the same CLI as you load the same setup you have. Subagents in another CLI get a short note listing your instruction files and skill folders to read. Claude, Codex and OpenCode workers get message_parent (progress notes), ask_parent (a question; it waits for your answer) and check_parent_messages (follow-ups you send). OpenCode also receives instruction-file paths in its config and exposes the parent tools individually with codemode: false. Antigravity workers get them in their own temporary home; the primary file-login fallback has no parent channel. See Gemini messages. With max_depth = 2, Claude, Codex and Antigravity workers one level below you may start helpers of their own (at most their own access and folders; their helpers can't go further); OpenCode workers can't. Antigravity workers get these tools from a subagents server, described without the product name (Gemini helpers). Tools built into the Claude desktop app itself (its browser or terminal panes, for example) aren't available to them. Plugins from another CLI are not translated into OpenCode plugins.
Never put secrets or credentials in a prompt.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lunati228/cli-subagents --plugin cli-subagentsOther plugins' skills for the same job