Skip to main content
skill CX Codex

Codex · softaworks — Claude Code skill: code analysis and refactoring

A skill that runs Codex CLI for code analysis, refactoring, and automated editing. Uses GPT-5.2 by default with adaptive reasoning, hitting 76.3% on SWE-bench.

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

What codex does

Codex brings GPT-5.2 into your editor: you describe a task, the skill invokes codex exec with the right reasoning level (xhigh, high, medium, low) and sandbox mode (read-only, workspace-write, or danger-full-access). Under the hood — CLI v0.57.0+ that manages the model, analysis depth, and filesystem access.

Workflow is straightforward: the skill asks for reasoning level and sandbox mode, then runs the command with flags like -m, --config model_reasoning_effort, --sandbox, --skip-git-repo-check and suppresses stderr (thinking tokens) by default. After execution, it offers to resume the session via codex resume --last to refine or expand the analysis without a restart.

GPT-5.2 is cheaper and faster than GPT-5.1 (30% savings on standard tasks), and cached input gets a 90% discount, valid for up to 24 hours. For harder cases, gpt-5.2-max provides 128K output, and gpt-5.2-mini quadruples your allowance. Requires Codex CLI v0.57.0 or newer.

What it helps with

  • analyze code and find bugs
  • refactor functions and architecture
  • apply automated fixes to files
  • optimize code performance
  • check security and best practices

Example prompts for the agent

  • Analyze my index.ts for production-readiness issues, use high reasoning
  • Refactor the entire User class for readability, workspace-write mode
  • codex resume — continue the analysis and suggest SQL query optimization

How to install codex

1Skills CLI (Vercel)

npx skills add softaworks/agent-toolkit --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/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about codex

How do I install Codex in Claude Code?

Run npx skills add softaworks/agent-toolkit --skill codex -a claude-code, then open ~/.claude/skills/codex/SKILL.md to verify. On other platforms the command differs: for Codex use npx skills add softaworks/agent-toolkit --skill codex -a codex, for Cursor use npx skills add softaworks/agent-toolkit --skill codex -a cursor.

What is reasoning effort and which should I pick?

It controls analysis depth: xhigh for very complex tasks (architecture, deep bugs), high for refactoring and security, medium for standard changes, low for simple edits. The skill will ask before running.

Can I continue a session after the first analysis?

Yes, use codex resume or say 'codex resume' — the skill restores the model, reasoning effort, and sandbox mode from the prior run and waits for your next task.

Source text

SKILL.md · MIT
---
name: codex
description: Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing. Uses GPT-5.2 by default for state-of-the-art software engineering.
---

# Codex Skill Guide

## Running a Task
1. Default to `gpt-5.2` model. Ask the user (via `AskUserQuestion`) which reasoning effort to use (`xhigh`,`high`, `medium`, or `low`). User can override model if needed (see Model Options below).
2. Select the sandbox mode required for the task; default to `--sandbox read-only` unless edits or network access are necessary.
3. Assemble the command with the appropriate options:
   - `-m, --model <MODEL>`
   - `--config model_reasoning_effort="<high|medium|low>"`
   - `--sandbox <read-only|workspace-write|danger-full-access>`
   - `--full-auto`
   - `-C, --cd <DIR>`
   - `--skip-git-repo-check`
3. Always use --skip-git-repo-check.
4. When continuing a previous session, use `codex exec --skip-git-repo-check resume --last` via stdin. When resuming don't use any configuration flags unless explicitly requested by the user e.g. if he species the model or the reasoning effort when requesting to resume a session. Resume syntax: `echo "your prompt here" | codex exec --skip-git-repo-check resume --last 2>/dev/null`. All flags have to be inserted between exec and resume.
5. **IMPORTANT**: By default, append `2>/dev/null` to all `codex exec` commands to suppress thinking tokens (stderr). Only show stderr if the user explicitly requests to see thinking tokens or if debugging is needed.
6. Run the command, capture stdout/stderr (filtered as appropriate), and summarize the outcome for the user.
7. **After Codex completes**, inform the user: "You can resume this Codex session at any time by saying 'codex resume' or asking me to continue with additional analysis or changes."

### Quick Reference
| Use case | Sandbox mode | Key flags |
| --- | --- | --- |
| Read-only review or analysis | `read-only` | `--sandbox read-only 2>/dev/null` |
| Apply local edits | `workspace-write` | `--sandbox workspace-write --full-auto 2>/dev/null` |
| Permit network or broad access | `danger-full-access` | `--sandbox danger-full-access --full-auto 2>/dev/null` |
| Resume recent session | Inherited from original | `echo "prompt" \| codex exec --skip-git-repo-check resume --last 2>/dev/null` (no flags allowed) |
| Run from another directory | Match task needs | `-C <DIR>` plus other flags `2>/dev/null` |

## Model Options

| Model | Best for | Context window | Key features |
| --- | --- | --- | --- |
| `gpt-5.2-max` | **Max model**: Ultra-complex reasoning, deep problem analysis | 400K input / 128K output | 76.3% SWE-bench, adaptive reasoning, $1.25/$10.00 |
| `gpt-5.2` ⭐ | **Flagship model**: Software engineering, agentic coding workflows | 400K input / 128K output | 76.3% SWE-bench, adaptive reasoning, $1.25/$10.00 |
| `gpt-5.2-mini` | Cost-efficient coding (4x more usage allowance) | 400K input / 128K output | Near SOTA performance, $0.25/$2.00 |
| `gpt-5.1-thinking` | Ultra-complex reasoning, deep problem analysis | 400K input / 128K output | Adaptive thinking depth, runs 2x slower on hardest tasks |

**GPT-5.2 Advantages**: 76.3% SWE-bench (vs 72.8% GPT-5), 30% faster on average tasks, better tool handling, reduced hallucinations, improved code quality. Knowledge cutoff: September 30, 2024.

**Reasoning Effort Levels**:
- `xhigh` - Ultra-complex tasks (deep problem analysis, complex reasoning, deep understanding of the problem)
- `high` - Complex tasks (refactoring, architecture, security analysis, performance optimization)
- `medium` - Standard tasks (refactoring, code organization, feature additions, bug fixes)
- `low` - Simple tasks (quick fixes, simple changes, code formatting, documentation)

**Cached Input Discount**: 90% off ($0.125/M tokens) for repeated context, cache lasts up to 24 hours.

## Following Up
- After every `codex` command, immediately use `AskUserQuestion` to confirm next steps, collect clarifications, or decide whether to resume with `codex exec resume --last`.
- When resuming, pipe the new prompt via stdin: `echo "new prompt" | codex exec resume --last 2>/dev/null`. The resumed session automatically uses the same model, reasoning effort, and sandbox mode from the original session.
- Restate the chosen model, reasoning effort, and sandbox mode when proposing follow-up actions.

## Error Handling
- Stop and report failures whenever `codex --version` or a `codex exec` command exits non-zero; request direction before retrying.
- Before you use high-impact flags (`--full-auto`, `--sandbox danger-full-access`, `--skip-git-repo-check`) ask the user for permission using AskUserQuestion unless it was already given.
- When output includes warnings or partial results, summarize them and ask how to adjust using `AskUserQuestion`.

## CLI Version

Requires Codex CLI v0.57.0 or later for GPT-5.2 model support. The CLI defaults to `gpt-5.2` on macOS/Linux and `gpt-5.2` on Windows. Check version: `codex --version`

Use `/model` slash command within a Codex session to switch models, or configure default in `~/.codex/config.toml`.

© softaworks · MIT · softaworks/agent-toolkit

Similar skills

Everything for Code review and refactoring →

codex by other authors comes first.

codex Hermes Agent 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. CX Codex +1 414installs codex typeui.sh Enforces a radically minimal monochrome design system and generates component specifications compliant with WCAG 2.2 AA. CX Codex +1 2,200installs codex skills-directory A skill that tells your agent how to drive Codex CLI: pick a model and reasoning effort, build the codex exec command, and resume sessions. CX Codex +1 495installs codex giuseppe-trisciuoglio Delegates complex code generation, refactoring, and code reviews to the Codex CLI using GPT-5.3-codex, o3, or o4-mini models. CX Codex +1 3,400installs rust-symbol-analyzer actionbook An LSP-based skill that maps a Rust codebase: modules, structs, traits, functions. Useful when you open an unfamiliar crate and need the layout fast. CX Codex +1 3,100installs tldr-router parcadei Tells the agent which tldr command fits the question: file tree, call graph, complexity, data flow. CX Codex +1 477installs jscpd kucherenko Detects duplicate code across 220+ languages and formats findings for AI agents. It flags exact copies, renamed blocks, and refactoring hotspots. CX Codex +1 2,600installs gitnexus-refactoring abhigyanpatwari Guides safe symbol renames, module extractions, and function splits in your project. It relies on GitNexus code graphs rather than plain text matching. CX Codex +1 1,700installs analyze-project lllllllama Reads a deep learning repository and maps its structure, entrypoints and suspicious spots. Changes nothing, runs no heavy jobs. CX Codex +1 337,200installs powershell-module-architect VoltAgent Community A subagent for designing and refactoring PowerShell modules, profiles, and automation libraries. Use it when code must work across PowerShell 5.1 and 7+. 183installs

From the same set12

database-schema-designer Design SQL and NoSQL data models with relationships, constraints, indexes, and migrations. Useful when starting a schema or reviewing one that already exists. CX Codex +1 4,300installs qa-test-planner Turns a feature description into a test plan, manual test cases, a regression suite or a bug report. Fires only when you name it: qa-test-planner. CX Codex +1 4,300installs session-handoff Creates handoff documents for AI agent session transfers. Useful when context window fills up or projects span multiple sessions. CX Codex +1 4,200installs react-dev Provides type-safe React 18 and 19 patterns for TypeScript components, hooks, and Server Actions. CX Codex +1 4,100installs feedback-mastery Guides developers and leads through difficult workplace conversations using the SBI and Preparation-Delivery-Follow-up frameworks. Helps turn friction into factual feedback. CX Codex +1 4,000installs gemini Tells your agent how to drive Gemini CLI for code review, plan review, or files too large for its own context. Useful when you want a second opinion on a whole repo. CX Codex +1 4,000installs reducing-entropy A skill that measures success by the size of the codebase afterwards, not by the effort spent. It runs only when you ask, and it deletes. CX Codex +1 4,000installs plugin-forge Skill for creating and managing Claude Code plugins with proper structure, manifests, and marketplace integration. Use it when building plugins for distribution or setting up plugin components like commands and hooks. CX Codex +1 3,900installs

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