Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

Codex — Claude Code skill: automate coding, refactoring, and PR

This skill delegates coding tasks to OpenAI's Codex agent via CLI. Use it to automate features, refactoring, PR reviews, and batch issue fixes directly from the terminal.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add NousResearch/hermes-agent --skill codex -a claude-code
Open on GitHub

What codex does

Codex is OpenAI's autonomous coding agent accessible through a command-line interface. The skill runs Codex in one-shot mode for quick tasks or background mode for long-running work, then tracks progress.

Two execution modes are available: exec for one-off commands, and --sandbox workspace-write for file changes. The first runs a prompt and exits. The second auto-approves file edits within the workspace without asking each time. For destructive operations, --dangerously-bypass-approvals-and-sandbox exists but is rarely needed. Codex refuses to run outside a git repository by design — use git init in a temp folder for scratch work.

Background execution returns a session ID and lets you tail logs, submit answers to agent prompts, and kill the process. Critical: Codex is interactive and requires PTY mode; without pty=true, it will hang. Authentication requires either the OPENAI_API_KEY environment variable or an OAuth token from ~/.codex/auth.json after logging into the CLI.

What it helps with

  • execute a feature or refactoring without writing code manually
  • review a pull request automatically using an AI agent
  • fix multiple issues in parallel across separate branches
  • clone and safely review a PR from an external repository

Example prompts for the agent

  • Codex, add a dark mode toggle to the settings page
  • Refactor the auth module to improve error handling
  • Review PR #42 against main and summarize findings

How to install codex

1Skills CLI (Vercel)

npx skills add NousResearch/hermes-agent --skill codex -a claude-code

2Manually: put the files in place

~/.claude/skills/codex/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/codex/

From the same set42

The whole set →
dogfood Teknium (teknium1), Hermes Agent A skill for exploratory QA of a web app: it walks the pages, captures console errors and screenshots, then writes a bug report. Claude Code CX Codex Cursor +1 6,400installs humanizer Siqi Chen (@blader, https://github.com/blader/humanizer), ported by Hermes Agent This skill removes common AI writing patterns and gives drafts a more natural voice. Use it for docs, posts, emails, and other text. Claude Code CX Codex Cursor +1 1,300installs popular-web-designs Hermes Agent + Teknium (design systems sourced from VoltAgent/awesome-design-md) 54 real-world design systems (Stripe, Linear, Vercel, Claude) with CSS tokens, typography, and components for building pages styled after known brands. Claude Code CX Codex Cursor +1 914installs powerpoint Nous Research Creates, reads, and edits .pptx presentations with python-pptx. Use it for slide decks, extracting presentation content, and template-based updates. Claude Code CX Codex Cursor +1 751installs claude-design BadTechBandit Skill for building HTML artifacts — landing pages, prototypes, decks — in Claude Code, Codex and Cursor. Reads project context and produces a self-contained file with markup and styles. Claude Code CX Codex Cursor +1 645installs llm-wiki Hermes Agent A skill for building a persistent knowledge base from interlinked markdown files. The agent summarizes sources, cross-references pages, and maintains consistency while you curate and direct the analysis. Claude Code CX Codex Cursor +1 603installs yuanbao Teknium (teknium1), Hermes Agent Connects agents to Yuanbao groups to query members, send mentions using @nickname, and deliver direct messages with attachments. Claude Code CX Codex Cursor +1 564installs songwriting-and-ai-music Teknium (teknium1), Hermes Agent Provides songwriting structures, prosody techniques, and Suno AI prompt formulas that rely on sound details rather than artist names. Claude Code CX Codex Cursor +1 563installs

Similar

resume-quantifier Paramchoudhary A skill that spots resume bullets without numbers and helps estimate metrics when exact data is missing. Useful when your experience section has no quantifiable results. Claude Code CX Codex Cursor +1 10,000installs android-emulator callstack This skill drives an Android Emulator with agent-device: it launches apps, checks live UI, and gathers debugging evidence. It fits native, React Native, Expo, and Flutter apps. Claude Code CX Codex Cursor +1 4,600installs tavily-search tavily-ai Runs web searches via the tvly CLI and returns LLM-tailored snippets with relevance scores. Use it when your agent needs fresh web sources without an exact URL. Claude Code CX Codex Cursor +1 36,000installs resume-section-builder Paramchoudhary A skill that generates resume sections tailored to experience level and role. Builds professional summaries, organizes skills, formats work history and education with different rules for entry level, mid-career and senior. Claude Code CX Codex Cursor +1 9,800installs inspector-docs CopilotKit Keeps CopilotKit documentation aligned with shipped Inspector overlay panes. Use it when adding, editing, or deleting tabs in @copilotkit/web-inspector. Claude Code CX Codex Cursor +1 1,000installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. Claude Code 1,052,851installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. Claude Code 711,230installs writing-plans Jesse Vincent This skill turns requirements for a multi-step task into an implementation plan before code changes begin. It helps when another engineer needs exact files, interfaces, and checks. Claude Code CX Codex 282,859installs

Questions about codex

How do I install the Codex skill in Claude Code?

Run npx skills add NousResearch/hermes-agent --skill codex -a claude-code. The skill will then be available in ~/.claude/skills/codex/SKILL.md.

What does the Codex skill do?

It delegates coding tasks to OpenAI's autonomous Codex agent via terminal. It can build features, refactor code, review PRs, and fix bugs in parallel.

What do I need to use Codex?

Install the CLI with npm install -g @openai/codex, configure OpenAI auth (either OPENAI_API_KEY or OAuth in ~/.codex/auth.json), and run inside a git repository. Always use pty=true or the process will hang.

Source text

SKILL.md · MIT
---
name: codex
description: "Delegate coding to OpenAI Codex CLI (features, PRs)."
version: 1.0.1
author: Hermes Agent
license: MIT
platforms: [linux, macos, windows]
metadata:
  hermes:
    tags: [Coding-Agent, Codex, OpenAI, Code-Review, Refactoring]
    related_skills: [claude-code, hermes-agent]
---

# Codex CLI

Delegate coding tasks to [Codex](https://github.com/openai/codex) via the Hermes terminal. Codex is OpenAI's autonomous coding agent CLI.

## When to use

- Building features
- Refactoring
- PR reviews
- Batch issue fixing

Requires the codex CLI and a git repository.

## Prerequisites

- Codex installed: `npm install -g @openai/codex`
- OpenAI auth configured: either `OPENAI_API_KEY` or Codex OAuth credentials
  from the Codex CLI login flow
- **Must run inside a git repository** — Codex refuses to run outside one
- Use `pty=true` in terminal calls — Codex is an interactive terminal app

For Hermes itself, `model.provider: openai-codex` uses Hermes-managed Codex
OAuth from `~/.hermes/auth.json` after `hermes auth add openai-codex`. For the
standalone Codex CLI, a valid CLI OAuth session may live under
`~/.codex/auth.json`; do not treat a missing `OPENAI_API_KEY` alone as proof
that Codex auth is missing.

## One-Shot Tasks

```
terminal(command="codex exec 'Add dark mode toggle to settings'", workdir="~/project", pty=true)
```

For scratch work (Codex needs a git repo):
```
terminal(command="cd $(mktemp -d) && git init && codex exec 'Build a snake game in Python'", pty=true)
```

## Background Mode (Long Tasks)

```
# Start in background with PTY
terminal(command="codex exec --sandbox workspace-write 'Refactor the auth module'", workdir="~/project", background=true, pty=true)
# Returns session_id

# Monitor progress
process(action="poll", session_id="<id>")
process(action="log", session_id="<id>")

# Send input if Codex asks a question
process(action="submit", session_id="<id>", data="yes")

# Kill if needed
process(action="kill", session_id="<id>")
```

## Key Flags

| Flag | Effect |
|------|--------|
| `exec "prompt"` | One-shot execution, exits when done |
| `--sandbox workspace-write` (`-s`) | Sandboxed but auto-approves file changes in the workspace (the recommended auto-build mode) |
| `--dangerously-bypass-approvals-and-sandbox` | No sandbox, no approvals (fastest, most dangerous; `--yolo` still works as a hidden alias) |
| `--sandbox danger-full-access` | No Codex sandbox; useful when the host service context breaks bubblewrap |

> **Deprecated:** `--full-auto` still works but the live CLI warns to use `--sandbox workspace-write` instead.

## Hermes Gateway Caveat

When invoking the Codex CLI from a Hermes gateway/service context (for example,
Telegram-driven agent sessions), Codex `workspace-write` sandboxing may fail even
when the same command works in the user's interactive shell. A typical symptom is
bubblewrap/user-namespace errors such as `setting up uid map: Permission denied`
or `loopback: Failed RTM_NEWADDR: Operation not permitted`.

In that context, prefer:

```
codex exec --sandbox danger-full-access "<task>"
```

Use process boundaries as the safety layer instead: explicit `workdir`, clean git
status before launch, narrow task prompts, `git diff` review, targeted tests, and
human/agent confirmation before committing broad changes.

## PR Reviews

Clone to a temp directory for safe review:

```
terminal(command="REVIEW=$(mktemp -d) && git clone https://github.com/user/repo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && codex review --base origin/main", pty=true)
```

## Parallel Issue Fixing with Worktrees

```
# Create worktrees
terminal(command="git worktree add -b fix/issue-78 ~/.hermes/cache/scratch/issue-78 main", workdir="~/project")
terminal(command="git worktree add -b fix/issue-99 ~/.hermes/cache/scratch/issue-99 main", workdir="~/project")

# Launch Codex in each
terminal(command="codex --sandbox workspace-write exec 'Fix issue #78: <description>. Commit when done.'", workdir="~/.hermes/cache/scratch/issue-78", background=true, pty=true)
terminal(command="codex --sandbox workspace-write exec 'Fix issue #99: <description>. Commit when done.'", workdir="~/.hermes/cache/scratch/issue-99", background=true, pty=true)

# Monitor
process(action="list")

# After completion, push and create PRs
terminal(command="cd ~/.hermes/cache/scratch/issue-78 && git push -u origin fix/issue-78")
terminal(command="gh pr create --repo user/repo --head fix/issue-78 --title 'fix: ...' --body '...'")

# Cleanup
terminal(command="git worktree remove ~/.hermes/cache/scratch/issue-78", workdir="~/project")
```

## Batch PR Reviews

```
# Fetch all PR refs
terminal(command="git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'", workdir="~/project")

# Review multiple PRs in parallel
terminal(command="codex exec 'Review PR #86. git diff origin/main...origin/pr/86'", workdir="~/project", background=true, pty=true)
terminal(command="codex exec 'Review PR #87. git diff origin/main...origin/pr/87'", workdir="~/project", background=true, pty=true)

# Post results
terminal(command="gh pr comment 86 --body '<review>'", workdir="~/project")
```

## Rules

1. **Always use `pty=true`** — Codex is an interactive terminal app and hangs without a PTY
2. **Git repo required** — Codex won't run outside a git directory. Use `mktemp -d && git init` for scratch
3. **Use `exec` for one-shots** — `codex exec "prompt"` runs and exits cleanly
4. **`--sandbox workspace-write` for building** — auto-approves changes within the sandbox (`--full-auto` is deprecated for this)
5. **Background for long tasks** — use `background=true` and monitor with `process` tool
6. **Don't interfere** — monitor with `poll`/`log`, be patient with long-running tasks
7. **Parallel is fine** — run multiple Codex processes at once for batch work

© Hermes Agent · MIT · NousResearch/hermes-agent

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor