Agent skill

Codex Agent

by majiayu000 in majiayu000/spellbook

A skill your agent uses when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals.

MITAuto-check passedDevelopment

Install Codex Agent

skills CLI
$ npx skills add majiayu000/spellbook --skill codex-agent -a claude-code

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

GitHub CLI
$ gh skill install majiayu000/spellbook codex-agent --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/majiayu000/spellbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/codex-agent .claude/skills/codex-agent && 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-agent
GitHub stars
287
Token cost
~1.9k tokens
SKILL.md length
513 words
Files
7 (incl. scripts)
Skills in repo
97
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals.

  • Works in 3 steps: Call Codex and Read Feedback → Apply Fixes Based on Codex Feedback → Re-verify with Codex (Optional)
  • You want a second-opinion review via Codex CLI
  • SKILL.md covers Optional Codex Review Workflow, Workflow Examples, Review Request Format and Applying Fixes, plus 8 more sections
  • Runs Shell scripts from its folder; calls codex, git and npm

What it does

Codex Agent is an agent skill from majiayu000/spellbook. Use when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals. Requires Codex CLI to be installed and authenticated.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts (for example `README.md`, `advanced.md` and `examples.md`). Compatibility notes: Designed for Claude Code with an installed and authenticated Codex CLI.

It sits in Development, covering Proposals and quotes and Debugging. The repository describes itself as: Cross-runtime skills for Claude Code, Codex, and multi-agent workflows. The licence is MIT.

When your agent uses it

  • You want a second-opinion review via Codex CLI
  • Cross-verification after another agent implements changes
  • Alternative implementation proposals

Example prompts

  • “/codex-agent”

Requirements

  • Node.js
  • A Bash shell
  • Compatibility (from SKILL.md): Designed for Claude Code with an installed and authenticated Codex CLI.
  • Pre-approved tools (allowed-tools): Bash(REPORT=*), Bash(DIFF_REPORT=*), Bash(codex:*), Bash(mktemp:*), Bash(cat:*), Bash(git diff:*), Read, Edit, Grep, Glob

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Call Codex and Read Feedback
  2. Apply Fixes Based on Codex Feedback
  3. Re-verify with Codex (Optional)

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(REPORT=*)
    • Bash(DIFF_REPORT=*)
    • Bash(codex:*)
    • Bash(mktemp:*)
    • Bash(cat:*)
    • Bash(git diff:*)
    • Read
    • Edit
    • Grep
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • codex
    • git
    • npm
    • brew

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

  • Network

    No URLs in SKILL.md. Its commands use git and npm, 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.

  • Compatibility

    Designed for Claude Code with an installed and authenticated Codex CLI.

    From compatibility in the SKILL.md frontmatter.

Context cost

Codex Agent loads about 1.9k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 513 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from majiayu000/spellbook at commit ed52af7, republished under its MIT licence (© majiayu000). 513 words, ~1,922 tokens.

Download SKILL.mdSave it as .claude/skills/codex-agent/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
codex-agent
description
Use when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals. Requires Codex CLI to be installed and authenticated.
allowed-tools
Bash(REPORT=*), Bash(DIFF_REPORT=*), Bash(codex:*), Bash(mktemp:*), Bash(cat:*), Bash(git diff:*), Read, Edit, Grep, Glob
compatibility
Designed for Claude Code with an installed and authenticated Codex CLI.
metadata.spellbook-runtimes
claude_code

Codex Agent Collaboration Skill

This skill enables Claude Code to collaborate with OpenAI's Codex CLI agent for second-opinion review, cross-verification, debugging analysis, and alternative implementation proposals.

Default posture: Codex reviews in read-only; the primary agent applies changes only when the user asked for fixes or approved them after reading the review.

Optional Codex Review Workflow

Use this workflow when the user asks for Codex review, wants a second opinion, or needs cross-verification from a separate coding agent.

Step 1: Call Codex and Read Feedback
bash
REPORT="$(mktemp -t codex-review.XXXXXX.md)"
codex exec -C <project_path> -s read-only -o "$REPORT" \
  "Review the code in <file_or_directory>. Check for:
   - Security vulnerabilities
   - Performance issues
   - Code quality and best practices
   - Potential bugs and edge cases
   - Naming and readability
   Provide specific, actionable feedback with file paths and line numbers."

cat "$REPORT"

Keep the write and read in the same Bash call, or pass a concrete report path between calls; shell variables do not persist across tool calls.

Step 2: Apply Fixes Based on Codex Feedback

When the user asked to apply fixes, handle each issue identified by Codex:

  1. Read the relevant file
  2. Apply the fix using Edit tool
  3. Verify the fix addresses Codex's concern

If the user only asked for a review or second opinion, report findings without editing files.

Step 3: Re-verify with Codex (Optional)
bash
codex exec -C <project_path> -s read-only \
  "Verify the fixes applied to <files>. Confirm issues are resolved."

Workflow Examples

Example 1: Review and Fix a Single File
bash
# Step 1: Get Codex review
REPORT="$(mktemp -t codex-review.XXXXXX.md)"
codex exec -C /project -s read-only -o "$REPORT" \
  "Review src/auth/login.ts for security vulnerabilities and code quality issues. Provide specific line numbers and fixes."

# Step 2: Read the feedback
cat "$REPORT"

Then the primary agent reads the feedback, applies fixes with Edit tool, and optionally re-verifies.

Example 2: Review Recent Changes
bash
# Get diff of recent changes
DIFF_REPORT="$(mktemp -t recent-changes.XXXXXX.diff)"
git diff HEAD~1 > "$DIFF_REPORT"

# Step 1: Have Codex review the diff
REPORT="$(mktemp -t codex-review.XXXXXX.md)"
codex exec -C /project -s read-only -o "$REPORT" \
  "Review the changes saved at $DIFF_REPORT. Check for bugs, security issues, and improvements needed."

# Step 2: Read and apply fixes
cat "$REPORT"
Example 3: Full Project Review
bash
# Step 1: Comprehensive review
REPORT="$(mktemp -t codex-review.XXXXXX.md)"
codex exec -C /project -s read-only -o "$REPORT" \
  "Perform a comprehensive code review of src/. Focus on:
   1. Security vulnerabilities (OWASP Top 10)
   2. Error handling patterns
   3. Performance bottlenecks
   4. Code duplication
   Prioritize issues by severity (critical/high/medium/low)."

# Step 2: Read prioritized feedback
cat "$REPORT"

Review Request Format

When asking Codex for review, include:

Review <target_files_or_directory>.

Context:
- Project type: <TypeScript/Python/etc>
- Framework: <Express/React/etc>
- Focus areas: <security/performance/quality>

Check for:
1. Security vulnerabilities
2. Performance issues
3. Error handling
4. Code quality
5. Edge cases

Output format:
For each issue:
- File: <path>
- Line: <number>
- Severity: critical/high/medium/low
- Issue: <description>
- Fix: <specific code change>

Applying Fixes

After receiving Codex feedback, apply fixes systematically:

  1. Parse the review - Extract each issue with file, line, severity
  2. Prioritize - Fix critical/high issues first
  3. Read file - Use Read tool to see current code
  4. Apply fix - Use Edit tool with precise old_string/new_string
  5. Track progress - Mark each issue as fixed

Prerequisites

Codex CLI must be installed and authenticated:

bash
# Install via npm
npm install -g @openai/codex

# Or via Homebrew (macOS)
brew install --cask codex

# Authenticate
codex login

Command Reference

Basic Command Pattern
bash
codex exec [options] "<task_description>"
Core Options
OptionDescription
"<task>"Task description (positional, must be quoted)
-C <dir>Working directory (use absolute path)
-s read-onlyRead-only sandbox (use for reviews)
-o <path>Save output to file
--jsonOutput as JSON Lines
Show full SKILL.md (195 more words)Show less
AI-to-AI Communication

When communicating with Codex, PRIORITIZE ACCURACY AND PRECISION:

  • Use structured data and exact technical terms
  • Provide full file paths and precise details
  • Include relevant context from the current codebase
  • NO conversational formatting needed

Other Use Cases

Cross-Verification (after Claude implements)
bash
codex exec -C /project -s read-only \
  "Verify the implementation in src/feature/. Check correctness and edge cases."
Get Alternative Implementation
bash
REPORT="$(mktemp -t codex-alternative.XXXXXX.md)"
codex exec -C /project -s read-only -o "$REPORT" \
  "Propose an alternative implementation for the caching in src/cache/manager.ts"
cat "$REPORT"
Debugging Assistance
bash
codex exec -C /project -s read-only \
  "Debug: tests in tests/auth.test.ts failing with timeout. Analyze root cause."

Session Management

For multi-turn reviews:

bash
# Initial review
codex exec -C /project -s read-only "Review src/api/ for security issues"
# Note session ID from output

# Follow-up after fixes
codex exec resume <session_id> "I've applied the fixes. Please re-verify."

Helper Scripts

  • scripts/check-codex.sh checks whether the Codex CLI is installed and authenticated.
  • scripts/codex-wrapper.sh is optional. Use it only when you need a small CLI wrapper; it executes Codex through shell arrays and must not use eval.

Gotchas

  • Do not write reviews to fixed paths such as /tmp/codex-review.md; use mktemp or a project-specific private report path so concurrent projects cannot overwrite or read stale feedback.
  • Keep Codex review commands in read-only unless the user explicitly asked Codex itself to edit.
  • Treat danger-full-access, --dangerously-bypass-approvals-and-sandbox, --dangerously-bypass-hook-trust, and --skip-git-repo-check as high-impact flags. Ask before using them.
  • Do not blindly apply every Codex suggestion. Re-read the target file, confirm the root cause, and verify the final behavior.

Troubleshooting

Authentication Issues
bash
codex logout
codex login
Check Installation
bash
codex --version
which codex

See Also

© majiayu000, 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 6 other files (scripts) in skills/codex-agent of majiayu000/spellbook.

  • SKILL.md
  • README.md
  • advanced.md
  • examples.md
  • sandbox-modes.md
  • scripts/check-codex.sh
  • scripts/codex-wrapper.sh

Open the folder on GitHubat commit ed52af7

Compare with similar skills

Codex Agent 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 Agent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codex Agent this skillmajiayu000/spellbook287—~1.9kAutomated safety check: PassMIT
Task Createjiangzhe/doradb121—~581Automated safety check: PassApache-2.0
Plan Loopgaasher/Agent-Loop-Skills174—~2.6kAutomated safety check: PassMIT
Plan ArbiterBuilderIO/skills4.6k—~1kAutomated safety check: PassMIT
Qv Quality Reportingtetherto/qvac683—~1.6kAutomated safety check: PassApache-2.0
Dev Rfcpproenca/dot-skills215—~3.8kAutomated safety check: PassMIT

Similar skills

  • Task Create

    jiangzhe/doradb

    Design and create implementation-ready Doradb task documents through deep repository research, strict RFC complexity gating, two proposal and review rounds, explicit user approval, and isolated task…

    121 GitHub stars~581 tokensUpdated today
    DevelopmentAuto-check passed
  • Plan Loop

    gaasher/Agent-Loop-Skills

    A skill your agent uses when the user has a coding or engineering prompt and wants it refined into a detailed, executable plan before any code is written — the planning stage of a prompt → plan →…

    174 GitHub stars~2.6k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Plan Arbiter

    BuilderIO/skills

    A skill your agent uses when asked to compare, cross-review, merge, judge, choose, or arbitrate competing plans from multiple agents such as Codex and Claude Code; when given two or more proposed…

    4.6k GitHub stars~1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Run the deterministic code-quality audit, turn related findings into contextual remediation groups, prepare approval-gated Asana proposals, reconcile recurring runs, or configure twice-monthly…

    683 GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Dev Rfc

    pproenca/dot-skills

    Create well-structured RFCs and technical proposals for software projects.

    215 GitHub stars~3.8k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • QA

    mr-daedalium/ostack-saas

    Systematically QA test a web application and fix bugs found.

    114 GitHub starsUsed in 1 repo~10k tokens
    DevelopmentAuto-check: notes

More from majiayu000/spellbook

All 97 skills in this repo
  • Skill Ecosystem Doctor

    majiayu000/spellbook

    Audits and repairs how coding-agent Skills are owned, copied and exposed across runtimes, from canonical sources to quarantine and retirement.

    287 GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • AGENTS.md Scaffold

    majiayu000/spellbook

    Scans a repository for real evidence and proposes, or on request writes, a small stack of root and scoped AGENTS.md files with validation commands and generated-file boundaries.

    287 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Product Demo Builder

    majiayu000/spellbook

    Plans, produces or diagnoses evidence-backed product demo videos: script, capture plan, pacing checks and verified final media built on real product behavior.

    287 GitHub stars~3.3k tokensUpdated yesterday
    Auto-check passed
  • Flowguard Task Guard

    majiayu000/spellbook

    Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff.

    287 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • npm Supply Chain Check

    majiayu000/spellbook

    Scans a repository, its lockfiles and node_modules for known malicious npm package versions and install-time indicators, using a read-only Python scanner.

    287 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Product Manager Toolkit

    majiayu000/spellbook

    Product management helpers: a RICE scoring script, an interview transcript analyzer and PRD templates for prioritizing features, synthesizing research and writing requirements.

    287 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed

Questions about Codex Agent

What does Codex Agent do?

A skill your agent uses when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals. Codex Agent is an agent skill from majiayu000/spellbook. Use when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals.

When should I use Codex Agent?

Codex Agent fits situations like: you want a second-opinion review via Codex CLI; cross-verification after another agent implements changes; alternative implementation proposals.

How do I install Codex Agent in Claude Code?

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

How do I install Codex Agent in Codex?

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

Can I use Codex Agent 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 majiayu000/spellbook --skill codex-agent -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-agent, .gemini/skills/codex-agent, .github/skills/codex-agent and .opencode/skills/codex-agent in your project.

What does Codex Agent need to run?

Going by SKILL.md and its folder, Codex Agent needs a shell for the scripts in its folder and the command-line tools its instructions call (codex, git, npm and brew). Our summary lists: Node.js; A Bash shell. Its frontmatter pre-approves these tools: Bash(REPORT=*), Bash(DIFF_REPORT=*), Bash(codex:*), Bash(mktemp:*), Bash(cat:*), Bash(git diff:*), Read, Edit, Grep, Glob. Compatibility (from SKILL.md): Designed for Claude Code with an installed and authenticated Codex CLI..

Does Codex Agent access the network?

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

Is Codex Agent 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Codex Agent use?

Codex Agent 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 Agent use?

About 1.9k tokens (SKILL.md is roughly 7.7k 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 Agent?

Skills that share tags, products or a category with Codex Agent: Task Create (jiangzhe/doradb, 121 stars), Plan Loop (gaasher/Agent-Loop-Skills, 174 stars), Plan Arbiter (BuilderIO/skills, 4.6k stars) and Qv Quality Reporting (tetherto/qvac, 683 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codex Agent?

majiayu000 (a GitHub user) maintains it in majiayu000/spellbook, which has 287 GitHub stars. The repository holds 97 skills in this directory. The repository was last updated on October 8, 2026.

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