codex-pair

codex-pair is a skill for Claude Code, Codex from Lykhoyda/ask-llm. It costs 68 tokens per session (5,802 once invoked), scanned C, original, MIT.

A skill for pairing a coding agent with Codex as a read-only reviewer while another agent remains responsible for editing. It supports consent-controlled review flows for supported hosts such as Claude Code, Pi, and Cursor Agent.

In plain words
What is it for?
Use it to review individual edits or an iterative coding session, relay actionable findings, preserve session context where supported, and report host limitations or failures.
Why use it?
It provides a structured second review of edits while keeping the editor in control and limiting the files and context shared for review.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the ask-llm plugin — 18 skills, 9 agents, 5 hooks, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lykhoyda/ask-llm/codex-pair
Any agent
npx skills add Lykhoyda/ask-llm --skill codex-pair
Clone the repo
git clone --depth 1 https://github.com/Lykhoyda/ask-llm

Made for: Claude Code, Codex.

Or install ask-llm, the plugin that ships this one along with the rest of its 18 skills, 9 agents, 5 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codex-pair

README.md
[![agentmods](https://agentmods.dev/badge/skills/lykhoyda/ask-llm/codex-pair.svg)](https://agentmods.dev/skills/lykhoyda/ask-llm/codex-pair)
Your own site
<a href="https://agentmods.dev/skills/lykhoyda/ask-llm/codex-pair"><img src="https://agentmods.dev/badge/skills/lykhoyda/ask-llm/codex-pair.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,802 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00068 $0.05802
Opus 5 $0.00034 $0.02901
Sonnet 5 $0.00014 $0.01160
Haiku 4.5 $0.00007 $0.00580

Measured 4d ago against content hash 43b474338a67, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

codex-pair scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

To remove: rm -rf <MARKER_DIR>/.codex-pair
packages/claude-plugin/skills/codex-pair/SKILL.md · 358 lines

How it starts

The opening of the file, as written. The whole thing — 358 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Portable contract

Use Codex as an explicit read-only reviewer while the host remains the editor. Apply ../pairing-contract.md. Where the host supports the established per-edit integration, set up and report its status: the repository marker carries review context but is not, by itself, authorization on Pi. Preserve bounded file context, include-directory handling, reasoning effort, session continuity where supported, consent, cancellation, actionable relay, failure disclosure, and explicit host lifecycle limitations.

Host adapters

Pi adapter

Pi requires project trust, this repository marker, and explicit user-owned allowlist consent through /codex-pair. Pairing is asynchronous in TUI/RPC/long-lived JSON modes, uses tool_result, and surfaces findings non-blockingly. One-shot print mode, blocking Stop-gate parity, and nested Fable execution are unsupported.

Cursor Agent adapter

Cursor discovers this SKILL.md through its supported Agent Skills surface; /codex-pair attaches it as an explicit command. Do not use Claude Code's PostToolUse, Stop, SessionStart, SessionEnd, CLAUDE_PLUGIN_ROOT, AskUserQuestion, or plugin tool namespaces. This adapter is an on-demand iterative pairing session, not a claim that Claude hooks were registered in Cursor.

  1. Read ../pairing-contract.md. The Cursor plugin bundle registers only the unified ask-llm server; if the user separately installed @ask-llm/codex-mcp, prefer that deterministic ask-codex leaf. Resolve an exposed MCP tool whose exact leaf is ask-codex; do not assume its server prefix. When only the unified ask-llm leaf is registered, it may serve as the transport with provider: "codex" and every option (model, reasoning effort, include directories, session) pinned explicitly; its schema rejects unsupported combinations instead of stripping them and Codex runs read-only by default. Never make an unpinned generic call. If neither tool is exposed, stop with the recommended user-installed unified server:
    {"mcpServers":{"ask-llm":{"command":"npx","args":["-y","@ask-llm/mcp"]}}}
    
    Save that as project .cursor/mcp.json or user ~/.cursor/mcp.json, ensure codex is authenticated, reload the server from Cursor Settings → Tools & MCP or restart Cursor Agent, and invoke /codex-pair again. A split codex entry using @ask-llm/codex-mcp is an explicit user-installed alternative when only the ask-codex leaf is desired; keep one registration per server (the plugin already provides ask-llm, so do not add a second ask-llm entry merely to duplicate it).
  2. Require both model=<exact ID> and effort=low|medium|high|xhigh|max; parse optional include=dir1,dir2. If model or effort is omitted, ask the user to choose it and stop before reading extra context, requesting consent, or calling a provider. Do not infer either value from the Cursor host environment: the MCP server may resolve different ASK_CODEX_MODEL or ASK_CODEX_REASONING_EFFORT values. Reject absolute, .., and ~ include paths; cap at 32. Build a bounded context manifest (20 KB/file, 100 KB/request) from task requirements, relevant project instructions, changed files, and tests. Do not send secrets or unrelated files.
  3. Before the first provider call, show host=Cursor Agent, reviewer provider=codex, selected transport=ask-codex or unified ask-llm, exact user-supplied model, exact user-supplied reasoning effort, include directories, read-only behavior, data/quota boundary, and fresh persisted-session intent. Ask for explicit confirmation using Cursor's normal conversational approval surface. Refusal ends cancelled with no provider call.
  4. First call exactly one of these protocol shapes, substituting the already disclosed explicit choices:
    [
      {
        "tool": "ask-codex",
        "arguments": {
          "prompt": "<bounded reviewer prompt>",
          "model": "<required exact ID>",
          "reasoningEffort": "<required effort>",
          "includeDirs": ["<validated relative directory>"],
          "sessionId": "",
          "sandbox": "read-only"
        }
      },
      {
        "tool": "ask-llm",
        "arguments": {
          "provider": "codex",
          "prompt": "<bounded reviewer prompt>",
          "model": "<required exact ID>",
          "reasoningEffort": "<required effort>",
          "includeDirs": ["<validated relative directory>"],
          "sessionId": ""
        }
      }
    ]
    
    The prompt assigns Codex the independent reviewer role and requests actionable severity/file/line evidence. Capture the returned structured sessionId/Thread ID and actual model. Relay feedback before changing code; verify every finding against source and label it accepted, rejected, or deferred.
  5. At meaningful checkpoints, call the same tool with the captured sessionId, same model/effort, and bounded delta. On ask-codex, keep sandbox: "read-only"; unified ask-llm has no sandbox input and is read-only by default, so do not send an unsupported sandbox field. Omit includeDirs on resumed calls because codex exec resume does not support them (every Codex transport — split ask-codex, unified ask-llm, and Pi — rejects that combination at the shared executor instead of dropping the directories); never silently strip them from the first call. If no session ID was returned, stop with a session diagnostic instead of pretending continuity.
  6. A Cursor interrupt cancels the MCP request. Report cancelled and never retry another tool/model/provider. Preserve earlier feedback on later failure and report failed (partial). On success report completed with host, provider, requested/actual model, effort, session reuse count, context/include directories, accepted/rejected/deferred actions, and any reported Codex quota fallback. Never conceal fallback or rewrite a model.

Read the full file on GitHub · 358 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 358 lines · 68 tokens per session scan C 43b474338a67

Subscribe to this mod's changes

codex-pair is a skill published in the GitHub repository Lykhoyda/ask-llm (16 stars, last pushed yesterday), licensed MIT. It adds 68 tokens to every session and 5,802 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

glossary-init

USE WHEN setting up a repo for AI-first work, when an agent hallucinates domain term meaning, or when user asks to bootstrap / extend the repo's domain glossary. Surfaces candidate terms by identifier frequency, asks the user for 1-sentence definitions, writes GLOSSARY.md at repo root. Idempotent — re-running adds new…

Filip-Podstavec/claude-leverage · 119 tokens

conventions-init

USE WHEN setting up a repo for AI-first work (after /init-repo), or when the context-surface hook should start feeding repo conventions to agents before edits. Drafts conventions.yml at repo root: per-kind casing (inferred from the code), a vague-name denylist seed, directory roles, and a hand-filled house-rules…

Filip-Podstavec/claude-leverage · 124 tokens

opik

This skill should be used when the user needs to add Opik tracing or integrations to their code, instrument an LLM application, or needs reference for Opik SDK usage (Python, TypeScript, REST API). Use for tasks like "add tracing", "instrument my code", "use trackopenai", "add OpikTracer", "what span types are…

comet-ml/opik-claude-code-plugin · 84 tokens

claude-rescue

Use when running under Codex CLI and stuck, wanting a second implementation or diagnosis pass, or handing a substantial task to Claude Code through a real Claude Code subprocess — a genuinely different reasoning system, not another Codex run. Not relevant outside Codex sessions.

patrickserrano/lacquer · 57 tokens

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

composio-community/awesome-claude-plugins · 61 tokens

swarm

Run a multi-agent audit of a codebase by spawning specialized parallel subagents (security, performance, tests, architecture, dead-code), then synthesize their findings into a single prioritized action plan. Use this whenever the user runs /swarm, asks to "audit the repo," "review this codebase," "find issues across…

Zintellix/Claude-Skills · 138 tokens