Skip to content
Agentmart
Submit a tool

codex-first

Use when a task is mechanical enough to specify completely (implementation from a settled design, refactor, migration, tests, coverage, CI fix, dependency…

Skill by courtneyr-dev

IndexedMIT
Write a review

Chalk Labs

Need help deploying codex-first?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/courtneyr-dev-codex-first

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when a task is mechanical enough to specify completely (implementation from a settled design, refactor, migration, tests, coverage, CI fix, dependency bump, script) and bigger than a tiny edit, or when the user says 'have Codex build this', 'delegate the implementation', or 'codex-first'. Not for reviews or stuck-recovery.

Use cases: design, testing, devops, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/codex-first

What's inside

Skill name
codex-first
Description
Use when a task is mechanical enough to specify completely (implementation from a settled design, refactor, migration, tests, coverage, CI fix, dependency bump, script) and bigger than a tiny edit, or when the user says 'have Codex build this', 'delegate the implementation', or 'codex-first'. Not for reviews or stuck-recovery.
License
MIT
Instructions
90 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Codex-first: delegate implementation, keep judgment

Adapted from steipete's codex-first skill. Claude is the orchestrator; Codex is the implementation worker. Economics: move generation tokens to Codex — Claude spends tokens only on the spec and the review.

## Step 0 — should this be delegated at all?

Do it directly in Claude when ANY of these hold:

- **Tiny edit**: ~<20 changed lines with a single obvious change. Delegation overhead costs more than the work.
- **The spec IS the work**: ambiguity means design; design stays with Claude. If you can't write FROZEN DECISIONS, resolve the design first — don't delegate the ambiguity.
- **Session-bound tools needed**: MCP, browser, computer use, credentials, interactive auth.
- **Sensitive surface**: secrets, security-critical logic, destructive operations, releases/pushes/production/GitHub mutations.

Otherwise delegate: implementation from a frozen spec, refactors, mechanical migrations, test writing, coverage fills, CI fixes, dependency bumps, scripts/tooling, bulk mechanical exploration.

## Step 1 — preflight

```bash
command -v codex >/dev/null || echo "MISSING: npm install -g @openai/codex"
```

If missing or unauthenticated (`codex login`), tell the user and do the work directly rather than blocking.

Confirm the working tree state first (`git status -sb`) so you can attribute the diff to Codex afterward. If the tree is dirty with unrelated changes, note which files were already modified.

## Step 2 — write the frozen spec

Use the template at `~/.claude/skills/credit-routing/references/delegation-template.md`. Required fields: GOAL, REPO, RELEVANT FILES, CURRENT STATE, FROZEN DECISIONS, CONSTRAINTS, NON-GOALS, IMPLEMENTATION STEPS (if known), EXPECTED PROOF, TEST COMMAND, OUTPUT FORMAT. Spec quality decides success — a blank field means Codex guesses.

Always append this guard:

```
Do not read or modify anything under ~/.claude/, .claude/, agents/, or AGENTS.md files.
Do not make product, architecture, or naming decisions beyond the frozen ones.
If the spec is ambiguous, stop and report the ambiguity instead of guessing.
```

## Step 3 — delegate

Spec goes in a temp file, never inline:

```bash
P=$(mktemp)
cat >"$P" <<'EOF'
<the filled spec>
EOF
command codex exec -C <repo-root> -s workspace-write \
  -c model_reasoning_effort="high" \
  - <"$P" > /tmp/codex-last.md 2>&1
```

- Capture output by redirecting (`> /tmp/codex-last.md 2>&1`) — `codex exec` has no `-o` flag (exits 2 at 0.31.0), and stderr must be kept: startup failures are only diagnosable from it.
- A malformed `[mcp_servers.*]` entry in `~/.codex/config.toml` blocks every `codex exec` at startup. Bypass per-run with `-c 'mcp_servers={}'` — don't edit the user's config. Full failure catalog: `~/.claude/knowledge/wiki/tools/codex-cli.md`.
- Default sandbox is `workspace-write` (Codex can edit files and run tests inside the repo, nothing outside).
- Escalate to `--dangerously-bypass-approvals-and-sandbox` (`--yolo`) ONLY when the sandbox demonstrably blocks a needed command (network installs, global tooling) — say so when you do.
- Long tasks: run in the background (`run_in_background`) and continue orchestrating.

## Step 4 — verify (never skip)

Codex's report is advisory. Run the checklist at `~/.claude/skills/credit-routing/references/verification-checklist.md`:
`git status -sb` → read the full diff → compare against the spec (frozen decisions honored, non-goals untouched) → run the exact TEST COMMAND yourself → re-decide any assumption that was really a design call → scan for scope creep and secrets.

If the main context is hot, dispatch the `verification-reviewer` agent instead of reading the diff inline — but the final judgment stays with the main session.

## Step 5 — iterate or take over

Corrections go through resume, not a fresh session:

```bash
P2=$(mktemp); cat >"$P2" <<'EOF'
<what failed, exactly; what to change; same guard lines>
EOF
(cd <repo-root> && command codex exec resume --last \
  -s workspace-write -c model_reasoning_effort="high" \
  - <"$P2" > /tmp/codex-last.md 2>&1)
```

**After two failed rounds, take over and implement directly.** Note why the delegation failed.

## Step 6 — record

If the task produced durable learning: project code facts → gstack `/learn`; agent-ops rules (routing, template fixes, recurring delegation shapes) → `~/.claude/knowledge/wiki/` (+ index and log lines). Skip recording session-only details.

## Related

- gstack `/codex` — read-only review/challenge/consult (the advisor channel). Never modifies files.
- `codex:rescue` (openai-codex plugin) — stuck-recovery and second diagnosis pass.
- Credit routing policy — `~/.claude/CLAUDE.md` § Credit routing; full model in `~/.claude/knowledge/wiki/decisions/2026-07-08-credit-operating-model.md`.

From courtneyr-dev/agent-skills, MIT.

More from courtneyr-dev/agent-skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Sep 5, 2026 (1 month ago)
Last release
Sep 5, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from courtneyr-dev

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get codex-first running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying codex-first?

CallGet help
Cite this page

codex-first skill. Agent Mart. https://agentmart.dev/skills/courtneyr-dev-codex-first (last updated 2026-10-24)