Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Codex

ASecurity

Delegate coding work to the OpenAI Codex CLI (`codex exec`, non-interactive). Use this whenever the user says "codex", "codex se karwa", "spawn codex", "delegate to codex", asks you to "make codex build/fix/scaffold X", wants to change the codex model or reasoning effort, or wants a large build/scaffold/refactor task offloaded to another coding agent while you orchestrate. Also use it for a second opinion on a diff via `codex exec review`, and when the user has previously said coding should g...

2 stars
0 votes
0 copies
0 views
Added 9/28/2026
ai-agentsgoshellbashgitapidatabase

Works with

cliapi

Security Analysis

A100/100

Scanned 9/28/2026

Install to Claude Code

$npx -y skills add shauryaaojha/claude-code-delegate --skill codex --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codex?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Codex
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/shauryaaojha-codex/badge)](https://www.skillsdirectory.com/skills/shauryaaojha-codex)

More formats (shields.io, HTML) on the badges page.

Files
SKILL.md
---
name: codex
description: Delegate coding work to the OpenAI Codex CLI (`codex exec`, non-interactive). Use this whenever the user says "codex", "codex se karwa", "spawn codex", "delegate to codex", asks you to "make codex build/fix/scaffold X", wants to change the codex model or reasoning effort, or wants a large build/scaffold/refactor task offloaded to another coding agent while you orchestrate. Also use it for a second opinion on a diff via `codex exec review`, and when the user has previously said coding should go through codex and a new implementation task comes up.
---

# codex — delegating coding tasks to the Codex CLI

`codex exec` runs one autonomous coding turn in a workspace and exits. You stay the
orchestrator: you write the spec, spawn codex, verify its output (build/tests/diff), and
fix or re-prompt. Codex does the bulk of the typing.

## The command

```bash
codex exec "$(cat "<task-file>")" \
  --cd "<absolute-project-dir>" \
  --sandbox workspace-write \
  --dangerously-bypass-approvals-and-sandbox \
  --model gpt-5.6-terra \
  -o "<last-message-file>"
```

Or use the bundled runner, which does the same thing with less quoting risk:

```bash
bash ~/.claude/skills/codex/scripts/run_codex.sh <task-file> <project-dir> [model] [effort]
```

Why each flag matters:
- `exec` — non-interactive. Plain `codex` opens a TUI and hangs your shell.
- `"$(cat task-file)"` — put the prompt in a file, never inline. Multi-line prompts with
  backticks, `$`, quotes or heredocs break bash quoting (`unexpected EOF`) and PowerShell
  mangles them worse. Write the file with the Write tool, then `cat` it. (`codex exec -`
  reads the prompt from stdin, which also works: `codex exec - < task.md`.)
- `--cd` — the working root. Codex creates files relative to this dir, so point it at the
  exact repo you want changed.
- `--sandbox workspace-write` — lets it edit files in the workspace but not the wider
  machine. `read-only` for review/analysis tasks; `danger-full-access` only when it must
  touch things outside the repo.
- `--dangerously-bypass-approvals-and-sandbox` — no approval prompts (nobody can answer
  them in a background run). Confirm with the user the first time in a session; after that
  it is implied. Prefer `--approve-for-me` when you want the sandbox kept on.
- `--model` / `-c model_reasoning_effort=…` — pick explicitly (see below). Ask the user
  only if they have not stated a preference; otherwise reuse the last one they named.
- `-o <file>` — writes the agent's final message to a file. Handy when stdout is long:
  read that file instead of scrolling the log.
- `--json` — JSONL event stream, if you need to parse progress programmatically.
- `--skip-git-repo-check` — only when the target is not a git repo.
- Long runs: launch with the Bash tool's `run_in_background: true` (or `nohup … &`) and
  poll the log, so you are not blocked. There is no built-in timeout flag — use the Bash
  tool's `timeout` or wrap in `timeout 50m`.

## Models

`~/.codex/config.toml` holds the default (currently `gpt-5.6-terra`, effort `medium`).
Override per run:

| what | how |
|---|---|
| different model | `--model <id>` |
| more/less thinking | `-c model_reasoning_effort=high` (`minimal`/`low`/`medium`/`high`) |
| local/OSS model | `--oss --local-provider ollama` |

Raise effort for design-heavy or algorithmic work; leave it at medium for mechanical
edits. If a run dies on quota or rate limits, switch model rather than retrying the same
one, and tell the user what you switched to.

## Writing the task file

Codex starts cold — it has none of your conversation context. The task file is its entire
brief, so write it like a handoff to a competent contractor who has never seen the repo:

1. **Where** — absolute working dir on the first line (`You are working in C:/…/project`).
2. **Read first** — exact paths of spec, existing code and conventions it must match.
3. **Deliver** — numbered list of files/features with concrete acceptance criteria
   (`npm run build` and `npm test` must pass; function signatures stay identical; etc.).
4. **Don't** — what is *not* its job (e.g. "do not connect to any database"; "do not
   install X"; "do not touch app/api/**").
5. **Finish** — "End with a concise summary: files written, build/test results, anything
   you were unsure about." That summary is what lands in `-o` and on stdout; it is your
   only view into the run besides the diff.

Keep decisions *made*, not open — codex cannot ask you questions in exec mode, it will
guess. See `references/task-template.md` for a fill-in template.

## Reviewing instead of building

```bash
codex exec review --cd "<project-dir>" --sandbox read-only "Review the uncommitted diff for correctness bugs."
```
Useful as a second opinion on a diff you or another agent wrote. Read-only: it reports,
it does not edit.

## After the run — always verify

Codex reports success optimistically. Before telling the user it is done:

```bash
git status --short          # what it actually touched
npm run build && npm test   # or the project's equivalent
```

Typical leftovers to fix yourself (faster than a re-prompt): unused imports, stubbed
helpers left as TODO, a file written to the wrong folder, tests it "fixed" by weakening.
Re-prompt codex (new task file, or `codex exec resume --last "…"` to continue with its
context) only for substantial gaps.

If codex stops early or its quota dies mid-task, finish the remaining items yourself —
don't leave the user with a half-built tree.

## Other modes

- `codex exec resume --last "<follow-up>"` — continue the previous session with context.
- `codex exec fork --last "…"` — branch off a session without disturbing it.
- `codex exec --worktree …` — run in a managed git worktree, so the main tree stays clean.
- `codex apply` — apply the last agent-produced diff to the working tree.
- `codex -i <image> …` — attach screenshots (e.g. a broken UI) to the prompt.

Attribution

shauryaaojhashauryaaojha
View sourceMore from shauryaaojha →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

695601 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →