Skip to content
AI & Agents
Skill

/codex-first

Claude Code / OpenClaw-on-Claude work routing: delegate hands-on work to Codex under the native-Claude model gate. Keep specification, judgment, and verification in Claude; prefer isolated Codex-backed autoreview.

From plugin
agent-scripts
7.5k54 skills

Claude Code

$ npx -y skills add steipete/agent-scripts --skill codex-first --agent claude-code

SKILL.md

codex-first.SKILL.md
name: codex-first
description: "Claude Code / OpenClaw-on-Claude work routing: delegate hands-on work to Codex under the native-Claude model gate. Keep specification, judgment, and verification in Claude; prefer isolated Codex-backed autoreview."

Codex First

Launch flags — read first, copy verbatim

Default every Codex worker, **fresh or resumed**, to **GPT-6.1 Sol, high reasoning, Fast service tier** (`service_tier="fast"`, sent as API `priority`; Peter, 2026-10-30). Pass all three settings unless the user requests an override.

# fresh
codex exec --yolo -C "$WT" \
  -m gpt-6.1-sol -c 'model_reasoning_effort="high"' \
  --enable fast_mode -c 'service_tier="fast"' \
  -o "$OUT" - < "$ORDER"
# resume: pass the same flags again; resume does not inherit them
codex exec resume "$SID" --dangerously-bypass-approvals-and-sandbox \
  -m gpt-6.1-sol -c 'model_reasoning_effort="high"' \
  --enable fast_mode -c 'service_tier="fast"' -o "$OUT" -
  • Old Codex CLIs silently omit tiers they do not know (codex-cli 0.147 on Team warned

`not advertised` and sent no tier); keep the CLI current. Verified on Team with 0.166.0, 2026-10-30.

  • Ultrafast only on request: swap in `-c 'service_tier="ultrafast"'` and add

`-c 'model_auto_compact_token_limit=260000'`. It is served up to ~282k prompt tokens, flaky at 288–294k, and silently `fast` at ≥300k (measured 2026-10-13); the 260k cap keeps it there. Rollouts record only the requested tier; prove the served tier with a direct probe (`response.service_tier`). Details: [launch details](references/launch-details.md).

  • Context: workers get the base 500k window. Add `-p sol61-1m` (or `-p astra-1m`) only when the

order needs a whole-repo context; see `$codex-huge-context`.

  • Copy all model/reasoning/tier flags into wrappers; override only on user request. Verify launch

arguments (`fast` default; requested `ultrafast` is valid).

Security audits and cyber-classifier refusals → Daybreak Red (Peter, 2026-10-15/18)

Security audit lanes (threat models, injection/secret-exposure audits, permission inventories, security review of hardening diffs) launch on **Daybreak Red** from the start (Peter 2026-10-18: "use daylight red model for security audits"). Implementation workers stay on Sol.

Worker stops with `This content was flagged for possible cybersecurity risk` → relaunch or resume the same order on **Daybreak Red** (Peter: "use daybreak red if you hit a blocker with regular models"). Don't rephrase to dodge the classifier or hop between regular models.

  • Direct API only: the ChatGPT-account route returns 400 `not supported when using Codex with a

ChatGPT account`. Add `-c 'model_provider="openai_api_direct"'` (API key via the provider's auth command in `~/.codex/config.toml`).

  • Slug: the `model_catalog_json` entry whose `display_name` is `Daybreak Red`. Keep it out of

public artifacts (commits, PRs, issues, logs) per public model naming.

  • No Fast/Ultrafast tier: drop `--enable fast_mode` / `service_tier`; keep `model_reasoning_effort="high"`.
  • Verified 2026-10-15 with a one-line `codex exec` probe on the direct provider.

Capacity fallback (Peter, 2026-10-12)

Org caps `gpt-6.1-sol` at 40M tokens/min. Worker or resume fails with `Rate limit reached for gpt-6.1-sol ... tokens per min (TPM)`, `Selected model is at capacity`, or `overloaded` → resume that same session on **GPT-6 Astra, high, Fast** immediately (Peter, 2026-10-12: "use astra if sol has rate limits"); no waiting loop:

codex exec resume "$SID" --dangerously-bypass-approvals-and-sandbox \
  -m gpt-6-astra -c 'model_reasoning_effort="high"' \
  --enable fast_mode -c 'service_tier="fast"' -o "$OUT" -
  • Resume onto Astra keeps the thread (verified 2026-10-12: Sol-created session resumed on Astra and replied).

Fresh orders at capacity: same flags with `codex exec --yolo -C "$WT"`; a fresh launch that dies on capacity already has a session id in stderr (`session id: …`) — resume that, don't relaunch.

  • Back off only when Sol and Astra are both limited; then alternate with growing sleeps.
  • Wrapper retry triggers must match all three strings (`rate limit|at capacity|overloaded`);

matching only "rate limit" made capacity failures exit instead of falling back.

  • Autoreview at capacity: `--model gpt-6-astra --thinking high --codex-speed fast`. If autoreview

refuses because its provider/route doesn't match operator config, don't change config — review with a fresh-context subagent (diff + brief) and say so in the PR.

  • New workers still start on Sol 6.1 Fast; fall back per worker, only on the capacity error.
  • Restarts and recoveries: this skill's `scripts/codex-resume` does the

fallback, busy check, safe stop, and classified exits ([resume and watchdog](references/resume-and-watchdog.md)).

Wrapper and process hygiene (2026-10-12/13)

  • Never edit a running wrapper script in place: bash reads scripts incrementally, so live runs

execute the new bytes at their old offset. Write `x.new`, `bash -n`, `chmod +x`, then `mv` (rename keeps the old inode for running copies; forgetting `chmod` gives exit 126).

  • Never run `codex exec` under `set -e` in a wrapper: a rate-limit death exits non-zero and ends

the script before its fallback runs (2026-10-13, a 27-worker fleet). Capture the code (`… && rc=0 || rc=$?`) and classify it, or hand the session to `codex-resume`.

  • Killing a wrapper orphans its `codex exec` children; the next resume then fails with

`thread … already has an active writer`. Stop and resume with `codex-resume --stop "$SID"`: it finds the worker through its open rollout file (fresh launches don't carry `$SID` in argv, so `pgrep -f` misses them) and refuses while `scripts/pr` or git runs beneath it. A leftover `~/.codex/thread-writer-locks/$SID.lock` file without a live holder is harmless.

  • To redirect a running worker (new design/priority), `codex-resume --stop -p "$ORDER_FILE" "$SID"` (or `--message "…"`)
Read more
@steipete
Ships withagent-scripts

Shared agent instructions, skills, and small portable helpers for Peter's local workspaces.

Stars on GitHub

Momentum

stars in total
7.5k
Star history of steipete/agent-scripts on GitHub, a chart by star-history.com

Other skills on agent-scripts.

browser-use

browser-use

Control the user's existing signed-in Chrome: callable Codex Chrome plugin first, then OpenClaw extension-backed mcporter, with…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw2w393k
@openclaw@openclawInstall Skill

Questions about codex-first.

Which coding agents can use codex-first?
codex-first installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.