Skip to main content
Glama
Ryen-LTC

codex-subagent-for-claude

codex_spawn

Destructive

Dispatch a task to a Codex subagent and get an 8-digit task ID instantly. Run multiple tasks in parallel, then retrieve or steer results automatically.

Instructions

把一个任务派给 Codex 子代理,立即返回 8 位任务 id(wait_s>0 时先等一会儿,等到就直接给结果)。可以连续派多个,它们在同一个常驻 Codex 进程里并行执行。任务完成后结果会自动送回本会话;也可以用 codex_wait 主动等、codex_status 看进度、codex_steer 中途改方向、codex_interrupt 中断。传 thread_id 可在旧任务的上下文上续问;该 thread 上不能有仍在运行的任务。默认无沙箱、不审批:Codex 会直接改文件、跑命令。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo工作目录(绝对路径),默认当前目录
modelNo仅用户明确指定时填,默认 gpt-6-sol
detachNotrue = 不关心结果的后台任务;Claude 结束回合时不会因为它被拦下
effortNo推理强度,默认 high;简单任务可降到 low/medium
promptYes任务说明:目标、改动范围、完成标准(要跑什么验证)、返回格式(结论 + 文件:行号,不贴大段代码)
wait_sNo先同步等待这么多秒;估计几分钟内能完成的任务填 120~300 可直接拿到结果,长任务填 0 立即返回
persistNo把会话持久化到 Codex 历史,以便下次 Claude 会话还能用 thread_id 续问;默认不持久化
sandboxNo默认 danger-full-access(无沙箱);只读分析用 read-only
worktreeNo在独立 git worktree(分支 codex-sub/<id>)里执行,多任务并行改同一仓库时用,完成后自行合并分支
thread_idNo续问:在之前某个任务的 thread 上继续,保留全部上下文,只发增量指令

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare destructiveHint=true, openWorldHint=true and readOnlyHint=false, and the description corroborates with the critical behavioral warning that by default there is no sandbox and no approval, so Codex will directly modify files and run commands. It also discloses the detach semantics and the thread_id precondition (no still-running task on that thread), which annotations do not convey. It stops short of covering failure modes or rate/concurrency limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense paragraph with no filler; the core capability and return value are front-loaded, followed by the sibling routing and then the sandbox warning. It is slightly over-packed with the five sibling name-drops in one breath, but every sentence carries operational information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter mutating tool with no output schema, the description still explains the return value (8-digit id), how results arrive back to the session, the persistence option, and the default no-sandbox execution posture. Nothing an agent needs in order to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema: the detach flag's effect on turn blocking, the wait_s heuristic on which values yield an immediate result, and the constraint that a reused thread_id cannot have a running task. These are genuine additions rather than restatements of the schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (dispatch a task to a Codex subagent) and the immediate return value (8-digit task id), plus the wait_s shortcut. It names the sibling tools codex_wait, codex_status, codex_steer and codex_interrupt, so an agent can distinguish this spawn tool from its siblings without opening another schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use guidance: multiple concurrent dispatches are allowed and run in parallel in one resident process; task results auto-return to the session; thread_id is for continuing an old task's context but the thread must have no running task. It also surfaces the alternatives for monitoring/steering rather than leaving them to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.