Agent skill

Codex Subagent

by davidondrej in davidondrej/skills

Launch OpenAI Codex CLI as a subagent (ChatGPT subscription auth, no API key).

MITAuto-check passedAgent Workflows

Install Codex Subagent

skills CLI
$ npx skills add davidondrej/skills --skill codex-subagent -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davidondrej/skills codex-subagent --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davidondrej/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/agent-orchestration/codex-subagent .claude/skills/codex-subagent && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codex-subagent
GitHub stars
4.1k
Token cost
~1k tokens
SKILL.md length
426 words
Files
2
Skills in repo
51
Repo updated
First seen
Licence
MIT

At a glance

Launch OpenAI Codex CLI as a subagent (ChatGPT subscription auth, no API key).

  • Delegating a self-contained coding task to Codex from another agent — parallel implementation work
  • SKILL.md covers When to delegate, Preflight, Launch and Collect results, plus 4 more sections
  • Calls codex and git
  • A second opinion

What it does

Codex Subagent is an agent skill from davidondrej/skills. Launch OpenAI Codex CLI as a subagent (ChatGPT subscription auth, no API key). Use when delegating a self-contained coding task to Codex from another agent — parallel implementation work, a second opinion, or an independent verification pass.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Agent Workflows, covering Subagents. It works with OpenAI. The repository describes itself as: access to david ondrej's personal agent skills. The licence is MIT.

When your agent uses it

  • Delegating a self-contained coding task to Codex from another agent — parallel implementation work
  • A second opinion
  • An independent verification pass

Example prompts

  • “/codex-subagent”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit ea32e5f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • codex
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codex Subagent loads about 1k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 426 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davidondrej/skills at commit ea32e5f, republished under its MIT licence (© davidondrej). 426 words, ~1,048 tokens.

Download SKILL.mdSave it as .claude/skills/codex-subagent/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
codex-subagent
description
Launch OpenAI Codex CLI as a subagent (ChatGPT subscription auth, no API key). Use when delegating a self-contained coding task to Codex from another agent — parallel implementation work, a second opinion, or an independent verification pass.
disable-model-invocation
true
triggers
user, model

Codex CLI as a Subagent

Codex CLI is OpenAI's terminal coding agent. codex exec runs it non-interactively: it works autonomously in a sandbox, streams progress to stderr, and prints only the final message to stdout. Auth reuses the user's ChatGPT subscription — never an API key.

When to delegate

  • Self-contained coding task with clear success criteria (fix, feature, refactor, review).
  • Parallel work: several independent tasks at once (see Parallel runs).
  • Second opinion / independent verification of your own changes.

Do NOT delegate tasks that need conversation context you can't fully write into the prompt.

Preflight

bash
codex --version       # missing? npm i -g @openai/codex  (or: brew install --cask codex)
codex login status    # exit 0 + "Logged in using ChatGPT" = ready

Not logged in → stop and tell the user to run codex login (one-time browser OAuth). Never read, print, or copy credentials (~/.codex/auth.json).

Launch

bash
OUT=$(mktemp /tmp/codex-out.XXXXXX)
codex exec \
  --cd /path/to/repo \
  --model gpt-5.6-sol \
  --config model_reasoning_effort=high \
  --sandbox workspace-write \
  --output-last-message "$OUT" \
  "Full task prompt: goal, constraints, files to touch, definition of done." \
  </dev/null
  • Always use GPT 5.6 Sol (gpt-5.6-sol). Default reasoning effort to high. Pass both flags explicitly on every new Codex run.
  • Do NOT use Codex fast mode.
  • </dev/null is MANDATORY when stdin is not a real terminal (background shells, scripts): codex treats open stdin as extra context and waits forever for EOF.
  • Codex sees NOTHING of your conversation. Put all context in the prompt: goal, relevant paths, constraints, and how to verify it's done.
  • Long prompt? Pipe it via stdin instead: codex exec [flags] - < /tmp/task.md.
  • Wrap the command in a background/Bash subagent if your host agent has one (Cursor: Task tool with a shell subagent) so Codex's verbose stream stays out of the parent context. Fallback: a plain background terminal.
  • Runs take minutes and have no built-in timeout — background it and monitor.
  • Optional: --json for JSONL event stream.
Show full SKILL.md (173 more words)Show less

Collect results

bash
cat "$OUT"                            # final message = the deliverable
git -C /path/to/repo status --short   # see what Codex actually changed

Follow-up in the same session (run from the same cwd — resume filters by cwd):

bash
codex exec resume --last "follow-up instruction" </dev/null

Parallel runs

Parallelize only genuinely independent tasks, and assign file ownership upfront so results merge cleanly. One git worktree per Codex run — never two in the same tree:

bash
git worktree add /tmp/wt-taskA -b codex/task-a
codex exec --cd /tmp/wt-taskA --model gpt-5.6-sol \
  --config model_reasoning_effort=high --sandbox workspace-write \
  -o /tmp/outA.md "task A" </dev/null

Failure modes

  • Hangs forever with no output → stdin was left open. Kill it, relaunch with </dev/null.
  • codex login status non-zero → the user must run codex login. Don't work around it.
  • ChatGPT plan rate limit hit → report to the user; never retry in a loop.
  • "Not a git repo" error → add --skip-git-repo-check, or init a repo first.
  • Network is blocked inside the workspace-write sandbox by default. If the task needs it (installs, API calls): -c sandbox_workspace_write.network_access=true.
  • NEVER use --dangerously-bypass-approvals-and-sandbox.

Rules

  • One task per launch. Split big jobs into multiple launches.
  • Review Codex's diff yourself before declaring the task done.

Cursor-native wrapper (optional)

For auto-routing and /codex invocation inside Cursor, add ~/.cursor/agents/codex.md — a custom subagent whose description is "delegates coding tasks to Codex CLI" and whose body points at this skill.

© davidondrej, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/agent-orchestration/codex-subagent of davidondrej/skills.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit ea32e5f

Compare with similar skills

Codex Subagent next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codex Subagent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codex Subagent this skilldavidondrej/skills4.1k—~1kAutomated safety check: PassMIT
WebGPTNhahan/WebGPT116—~1.4kAutomated safety check: PassMIT
Codex Workflowsscasella/claude-dynamic-workflows-codex324—~13kAutomated safety check: PassMIT
Fusion Setupmihneaptu/opencode-fusion217—~7.5kAutomated safety check: PassMIT
Codex GuideK9i-0/ccpocket1.1k—~475Automated safety check: PassMIT
Claudish UsageMadAppGang/claudish1k—~9kAutomated safety check: PassNone

Similar skills

  • WebGPT

    Nhahan/WebGPT

    Hands bounded tasks from Codex to a signed-in ChatGPT web session at a chosen reasoning level, or opens a terminal chat in your project that you control.

    116 GitHub stars~1.4k tokensUpdated 14 days ago
    Agent WorkflowsAuto-check passed
  • Codex Workflows

    scasella/claude-dynamic-workflows-codex

    Run a dynamic-workflow script on a local Codex App Server — orchestrate many Codex / GPT agents (the agent / parallel / pipeline / phase / budget DSL) instead of Claude subagents, for codebase…

    324 GitHub stars~13k tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed
  • Fusion Setup

    mihneaptu/opencode-fusion

    A skill your agent uses when a user wants to set up, configure, install, or reconfigure the opencode Fusion agent team - a strong main/build agent that plans and reviews but cannot edit files…

    217 GitHub stars~7.5k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Codex Guide

    K9i-0/ccpocket

    Codex の使い方、CLI/app/IDE、rules・hooks・AGENTS.md・skills・subagents・config などを案内する。Codex や OpenAI 製品の仕様を答える前に必ず公式ドキュメントを確認し、rules/approval は codex execpolicy check で実検証すること。

    1.1k GitHub stars~475 tokensUpdated 4 days ago
    Agent WorkflowsAuto-check passed
  • Claudish Usage

    MadAppGang/claudish

    CRITICAL - Guide for using Claudish CLI ONLY through sub-agents to run Claude Code with any AI model (OpenRouter, Gemini, OpenAI, local models).

    1k GitHub stars~9k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • OpenAI Codex CLI Bridge

    taracodlabs/aiden

    Delegates code generation, editing and explanation tasks to the OpenAI Codex CLI, with commands for interactive, auto-edit, question-only and model-specific runs.

    849 GitHub starsUsed in 1 repo~826 tokens
    Agent WorkflowsAuto-check passed

More from davidondrej/skills

All 51 skills in this repo
  • Nagent

    davidondrej/skills

    Launch a new bb worker thread with the right project, model, worktree, and task brief.

    4.1k GitHub stars~1.7k tokensUpdated today
    Auto-check: notes
  • Browser Harness

    davidondrej/skills

    Direct browser control via CDP. An agent skill from davidondrej/skills.

    4.1k GitHub starsUsed in 2 repos~3k tokens
    Auto-check passed
  • Persistent Localhost

    davidondrej/skills

    Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents.

    4.1k GitHub stars~618 tokensUpdated today
    Auto-check passed
  • Reset Cursor Acp

    davidondrej/skills

    Reset a stuck Cursor ACP thread in <chat-system and reload its configuration.

    4.1k GitHub stars~728 tokensUpdated today
    Auto-check passed
  • Anti Sleep

    davidondrej/skills

    Keep a Mac awake for a set duration or while a process runs.

    4.1k GitHub stars~640 tokensUpdated today
    Auto-check: warnings
  • Bb CLI

    davidondrej/skills

    Use this when controlling bb. An agent skill from davidondrej/skills.

    4.1k GitHub stars~823 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Codex Subagent

What does Codex Subagent do?

Launch OpenAI Codex CLI as a subagent (ChatGPT subscription auth, no API key). Codex Subagent is an agent skill from davidondrej/skills. Launch OpenAI Codex CLI as a subagent (ChatGPT subscription auth, no API key).

When should I use Codex Subagent?

Codex Subagent fits situations like: delegating a self-contained coding task to Codex from another agent — parallel implementation work; A second opinion; an independent verification pass.

How do I install Codex Subagent in Claude Code?

Run `npx skills add davidondrej/skills --skill codex-subagent -a claude-code`. Or copy the skill folder (skills/agent-orchestration/codex-subagent in davidondrej/skills) into .claude/skills/codex-subagent in your project. Claude Code loads it when a task matches its description.

How do I install Codex Subagent in Codex?

Run `npx skills add davidondrej/skills --skill codex-subagent -a codex`. Or copy the skill folder (skills/agent-orchestration/codex-subagent in davidondrej/skills) into .agents/skills/codex-subagent in your project. Codex loads it when a task matches its description.

Can I use Codex Subagent in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davidondrej/skills --skill codex-subagent -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codex-subagent, .gemini/skills/codex-subagent, .github/skills/codex-subagent and .opencode/skills/codex-subagent in your project.

What does Codex Subagent need to run?

Going by SKILL.md and its folder, Codex Subagent needs the command-line tools its instructions call (codex and git). Our summary lists: Node.js.

Does Codex Subagent access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Codex Subagent safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codex Subagent use?

Codex Subagent is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codex Subagent use?

About 1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codex Subagent?

Skills that share tags, products or a category with Codex Subagent: WebGPT (Nhahan/WebGPT, 116 stars), Codex Workflows (scasella/claude-dynamic-workflows-codex, 324 stars), Fusion Setup (mihneaptu/opencode-fusion, 217 stars) and Codex Guide (K9i-0/ccpocket, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codex Subagent?

davidondrej (a GitHub user) maintains it in davidondrej/skills, which has 4,105 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on October 6, 2026.

Source: davidondrej/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.