Skip to main content
Glama

Delegate in background (paid)

codex_delegate_async

Delegate a coding task to Codex in the background and receive an immediate job ID; use for substantial multi-file implementations that might exceed synchronous timeouts.

Instructions

Delegate a coding task to Codex in the background and get a job_id back immediately (does not block on the run).

PAID — this spends Codex quota on every new call; use codex_delegate_dry_run or codex_status (both free) first if you only need to check scope or readiness.

Same propose-tier behavior as codex_delegate — Codex works in a throwaway git worktree and the result carries a reviewable diff that is NOT applied — but detached; prefer it for a substantial or multi-file implementation task that can exceed the synchronous deadline (built-in default 300s), since a sync run whose deadline expires loses its partial work (this job's own deadline is separately configured, built-in default 1800s). Starting a job commits to spend (it runs to completion or its wall-clock deadline even if you never poll). Poll codex_job_status; read/consume with codex_job_result/codex_job_consume_result; stop with codex_job_cancel. Requires a git repo with at least one commit; pass workspace_root (absolute).

NO NETWORK: like codex_delegate, this runs under workspace-write, which blocks network egress for commands Codex RUNS in the sandbox — the task must be self-contained (no push/fetch/gh/curl/publish/dependency install; those fail with a DNS/host-resolution error in the sandbox). This does NOT mean nothing leaves the machine: the Codex model call still sends your task (raw) to OpenAI and lets Codex read tracked files in the worktree and send their content. Codex auto-loads the resolved workspace's AGENTS.md and discovers skills in its .agents/skills/ and user-global $CODEX_HOME/skills/ (default ~/.codex/skills/), reachable from outside the workspace. For delegate, that workspace is the worktree; scrubbing it doesn't exclude $CODEX_HOME/skills/, so a selected skill's body can reach the model even if your task never mentions it. Secret redaction is best-effort and does not cover your task or files Codex reads itself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesThe coding task for Codex to implement inside a throwaway git worktree; the resulting diff is returned for review, not applied to your tree. Must be non-blank: empty or whitespace-only is rejected before any model call.
modelNoOverride the Codex model slug for this call; defaults to the server/Codex default when unset.
isolationNoCodex config isolation: 'inherit' | 'ignore-config' | 'ignore-rules'. Defaults to the server's configured value (built-in 'inherit'; `codex_status` reports the resolved one).
workspace_rootNoAbsolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning.
idempotency_keyNoOptional dedup key scoped to THIS tool + workspace. Same key + same args replays the prior result with no new spend; different args are refused (idempotency_conflict). Sync and _async are separate tools and never share a key. Omit for none; retention is bounded. Lifecycle: codex://params.
reasoning_effortNoOverride the Codex reasoning effort for this call (a model_reasoning_effort override); omit or pass null for the server default (CODEX_IN_CLAUDE_REASONING_EFFORT) or Codex's own resolution. An open, per-model string the backend validates at run time — commonly minimal|low|medium|high|xhigh; codex_models lists each model's advertised set (advisory). Rejection and bounds detail: codex://params.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=true, idempotentHint=false), the description exposes critical behavioral traits: it spends paid quota on every call, runs in a throwaway worktree with a non-applied diff, commits to the spend even if never polled, blocks network egress for sandbox commands, and sends the raw task and read file contents to OpenAI. It also discloses skill auto-loading and best-effort secret redaction, which is significant context not captured in the annotations.

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

Conciseness5/5

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

Though lengthy, the description is tightly organized with bolded section cues (PAID, NO NETWORK) and every sentence carries essential operational, cost, privacy, or lifecycle information. The core purpose is front-loaded in the first sentence, and the structure makes the long form scannable. Given the high-stakes paid async nature and the need to disclose privacy limitations, the length is justified and not wasteful.

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?

With an output schema present, the description does not need to detail the return values; it covers everything else needed for correct invocation: cost, async behavior, prerequisites, error-prone network constraints, privacy boundaries, deadlines, and the post-job polling/consumption/cancellation flow. The tool's complexity is high, and this description fully equips an agent to use it safely and effectively.

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?

The input schema already provides 100% coverage with detailed descriptions for all six parameters, so the baseline is 3. The description goes beyond the schema by reinforcing that `workspace_root` must be absolute and, more importantly, warns that the `task` is sent raw to OpenAI and that secret redaction does not cover it. This adds security-relevant meaning to the task parameter that the schema does not express.

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?

The description opens with a precise statement: 'Delegate a coding task to Codex in the background and get a `job_id` back immediately (does not block on the run).' This clearly identifies the action, the resource, and the async behavior, and it distinguishes this tool from the synchronous `codex_delegate` sibling. The paid/quota warning and the contrast with `codex_delegate_dry_run` further disambiguate its purpose.

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?

The description gives explicit when-to-use guidance: prefer this for substantial multi-file tasks that may exceed the 300s synchronous deadline, and use free dry-run/status checks first for scope/readiness. It also names the follow-up lifecycle tools (`codex_job_status`, `codex_job_result`, `codex_job_cancel`) and states the git-repo prerequisite and `workspace_root` requirement, making tool selection and invocation unambiguous.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/briandconnelly/codex-in-claude'

If you have feedback or need assistance with the MCP directory API, please join our Discord server