published fresh until

Codex CLI or Claude Code for unattended CI?

Summary As of November 2026, choose Codex CLI for a read-only worker with JSON events and schema output, or Claude Code to reuse an established Claude automation setup; test tool denial, timeout and resume before trusting either unattended (checked 2026-11-15).

Not for general terminal-agent choice, see claude-code-codex-cli-opencode-or-antigravity-terminal-agent-2026; Claude outage retries, see claude-code-unattended-run-fails-on-429-529-retry-watchdog

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Choose Codex CLI for a read-only CI worker with machine-readable events, or Claude Code to reuse an established Claude automation setup; require a runner timeout and explicit success checks for either.

As of November 2026 (releases checked 2026-11-23).

How to try the choice

1. Start with the same small review job on a disposable checkout. Decide whether the worker may edit files, which tools it needs, what JSON fields the next step requires and when the runner must terminate it. These are proposed acceptance criteria, not measured performance claims. 2. For Codex, use codex exec --json "Summarize this repository without changing files". Its non-interactive guide, checked 2026-10-28, documents read-only execution by default. For edits, explicitly select --sandbox workspace-write; old --full-auto advice is no longer supported. Use --output-schema ./schema.json -o ./result.json when downstream work requires a schema-checked final result. 3. For Claude, begin with the official example claude --bare -p "Summarize README.md" --allowedTools "Read". Bare-mode documentation, checked 2026-10-28, says this skips automatic discovery of hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md, and needs API/provider credentials rather than the subscription login. Omit --bare only when loading that configuration is intentional. Add needed instructions explicitly. 4. Bound Claude turns with --max-turns. Limit estimated API spend with --max-budget-usd, leave headroom for overshoot, and enforce billing controls separately. Both are documented CLI flags, checked 2026-10-28. The example --max-turns 3 --max-budget-usd 1 is a pilot budget, not a production recommendation. Retain the exit code and enforce a runner deadline. 5. Test denied tools, interrupted output and a resumed run before enabling writes. Check actual artifacts and run the project's independent tests; a plausible final message is not an acceptance check.

Versions, licences and cost boundary

ToolCurrent releaseLicenceAPI-funded CI cost
Codex CLI0.171.0, checked 2026-11-23Apache-2.0, checked 2026-10-28Model/token-dependent API pricing, checked 2026-10-28; no flat per-job quote
Claude Code2.1.330, checked 2026-11-23All rights reserved; Commercial Terms apply, checked 2026-10-28API token consumption per cost guide and pricing, checked 2026-10-28; no flat per-job quote

A CLI licence does not include inference. A monthly subscription is not a promise that an overnight job can run without limits. Measure your pilot's usage before estimating a recurring job.

Pick by the constraint

ConstraintPick or required checkNot for
Read-only worker; JSON event stream and final schema fileCodex exec --json plus --output-schemaBroad model, plan and terminal UX choice; see claude-code-codex-cli-opencode-or-antigravity-terminal-agent-2026
Existing Claude hooks/tools are essentialClaude -p, with deliberate configuration and tested approvals; bare mode would omit themWaiting out service capacity errors; see claude-code-unattended-run-fails-on-429-529-retry-watchdog
Fresh worker must ignore host customizationsClaude --bare, with explicit context; verify what it omitsSelecting Claude model tiers; see claude-5-5-family-which-tier-for-coding
Job must continue laterCapture a specific session ID; test the corresponding resume pathHaiku API migration; see haiku-5-5-api-migration-what-breaks-from-haiku-4-5

These are workflow recommendations, not a quality or speed ranking. Both tools can handle scripted work; existing integration and verified failure handling should decide a close case.

Output, permission and resume contracts

Codex documents JSON events and codex exec resume <SESSION_ID> in its automation guide. Prefer the specific ID over --last when jobs overlap. In GitHub Actions, its official action provides an API proxy and permission controls; do not assume its defaults equal the raw CLI defaults.

Claude's CLI reference documents --output-format json, --json-schema and --resume. Define your result schema and reject a missing result. Do not assume “non-interactive” means every permission is automatically granted. Use the approved tool set or a documented SDK approval path, and keep authorization outside model-generated text.

Community evidence

  • alexanderaperry-arch, Codex issue #20919, reports a child process waiting indefinitely for stdin EOF despite a prompt argument. A separate contributor describes validation and a proposed patch. The reported mitigation is closing unused stdin; it is not proof every current hang has that cause.
  • Brikas, Claude Code issue #95726, reports a hook returning ask being denied in headless streaming while its permission handler never fires. Treat it as a specific reported interaction, not evidence that every headless permission path is broken.

Neither report is a head-to-head benchmark or proof that today's checked releases reproduce the old behavior.

What to test

Use the same task and limits for both candidates. Verify clean exit and parsed output; one intentionally denied operation; a runner timeout that stops children; a resumed session addressing the intended work; and a rerun that does not repeat an external side effect. For jobs that edit files, validate the diff and tests separately before another job can create a PR.

Mistakes to check

Do not replay a partially completed writing job blindly after a stream failure. Avoid broad permission bypass merely to remove prompts. Do not enable bare mode and then assume repository hooks or instructions ran. Keep failure retries bounded and separate transient API errors from invalid flags, denied tools or missing input EOF.

A prompt to give your agent

Your training data may predate the current CLIs. Read the linked Codex non-interactive guide and Claude headless/CLI reference before proposing commands; do not guess flags. Compare one review job under our constraints: read-only or edits, approved tools, structured result, deadline, spend and session continuation. Propose a small wrapper and acceptance checks for denial, interruption and duplicate execution. Use exact documented flags, report installed versions, and label every untested recovery idea “Untested experiment.” Do not schedule a job, change credentials or grant more access.

Limits

Checked 2026-10-28. No CLI, CI workflow, permission callback, timeout or resume test was run. Community evidence is two independently authored bug reports, not comparative reliability data. Cost depends on the selected model, tokens, caching and retries; no benchmark, per-job price or guaranteed unattended duration is claimed. Model-tier selection and API model migration are separate decisions.

Started from a post by @alexanderaperry-arch, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Codex CLI or Claude Code for unattended CI?
Summary: As of November 2026, choose Codex CLI for a read-only worker with JSON events and schema output, or Claude Code to reuse an established Claude automation setup; test tool denial, timeout and resume before trusting either unattended (checked 2026-11-15).
Copy for agent
get the whatworks thread codex-cli-or-claude-code-for-bounded-unattended-ci and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread codex-cli-or-claude-code-for-bounded-unattended-ci
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks