codex-gate

codex-gate is a skill for Claude Code, Codex from Angel45604/the-foreman. It costs 193 tokens per session (11,805 once invoked), scanned A, original, MIT.

An automated review and investigation workflow for Codex. It can check plans, architecture decisions, implementation phases, or pre-PR branches, and can also help find the root cause of a bug.

In plain words
What is it for?
Use it to review planned or completed work, repeatedly check fixes until review issues are resolved, assess architecture or feature decisions, and investigate bugs.
Why use it?
It provides a repeatable second review pass and separates fixable code issues from decisions that need a person. In investigation mode, it diagnoses problems without automatically changing the code.

Skill for Claude CodeCodex

Part of the the-foreman plugin — 5 skills 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/angel45604/the-foreman/codex-gate
Any agent
npx skills add Angel45604/the-foreman --skill codex-gate
Clone the repo
git clone --depth 1 https://github.com/Angel45604/the-foreman

Made for: Claude Code, Codex.

Or install the-foreman, the plugin that ships this one along with the rest of its 5 skills.

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-gate

README.md
[![agentmods](https://agentmods.dev/badge/skills/angel45604/the-foreman/codex-gate.svg)](https://agentmods.dev/skills/angel45604/the-foreman/codex-gate)
Your own site
<a href="https://agentmods.dev/skills/angel45604/the-foreman/codex-gate"><img src="https://agentmods.dev/badge/skills/angel45604/the-foreman/codex-gate.svg" alt="Measured on agentmods" height="20"></a>
Per session 193 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 11,805 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00193 $0.11805
Opus 5 $0.00097 $0.05902
Sonnet 5 $0.00039 $0.02361
Haiku 4.5 $0.00019 $0.01180

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

Security

Grade A, and why

codex-gate scanned grade A 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.

The scan reads SKILL.md. This mod also ships 2 executable files (codex-gate.sh, codex-gate.test.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

> HTTP/`curl`, running tests/evals, or triggering jobs can have real, irreversible side effects (spend
plugin/skills/codex-gate/SKILL.md · 525 lines

How it starts

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

codex-gate — drive Codex as an automated review gate

<skill-dir> in the commands below = the directory containing THIS SKILL.md. Installed as a plugin that is the plugin's skills/codex-gate/ dir; installed as a personal skill it is ~/.claude/skills/codex-gate.

A user-global, local-only gate. The wrapper <skill-dir>/codex-gate.sh runs ONE Codex review (config-isolated, --sandbox read-only) and prints a one-line JSON status: {outcome, threadId, round, verdictPath, runDir, blockers, agentFixableBlockers, decisionBlockers, summary} (plus an additive coverage object for prepr/prepr-delta) where outcome ∈ APPROVE | BLOCK | INFRA_ERROR | OVERFLOW. YOU are the loop driver: read the status + the per-round verdict file, fix agent_fixable blockers, re-review via resume, and converge.

The investigate mode is a sibling workflow that reuses this exact machinery for a different job — root-causing a bug, not judging a change — and emits its own status. It does NOT review or auto-fix; see Investigation mode below.

Contract + Phase-0 pins: <skill-dir>/README.md. The contract source of truth is README.md (sibling of this file).

When the user invokes /codex-gate <mode> [args]

Run the matching mode and drive the loop below. Modes:

  • plan <file> — review a plan doc before ExitPlanMode. Code tier when run inside a git repo (so Codex can cross-check the plan against repo canon via read-only shell); doc tier when not in a repo.
  • bundle <dir> — review a PDR/ADR/execution-plan bundle (code tier; Codex reads repo canon).
  • phase-start <id> — snapshot the working tree BEFORE an implementation phase. Run this in the binding (before dispatching the implementer); it prints RUNDIR= / PHASE_HEAD= and writes nothing reviewable.
  • phase-review <id> — review just that phase's changes after the full Claude review bundle.
  • question <file>ground a DECISION (architecture/feature) through Codex BEFORE you put it to the user via AskUserQuestion. Not a review gate — it emits an advisory GROUNDED status, not APPROVE/BLOCK. Code tier when run inside a git repo (Codex grounds in real code/canon); doc tier when not in a repo.
  • investigate <brief>root-cause a bug through Codex (a SIBLING of the review gate, NOT a review). Drives Codex as an independent read-only investigator bound by a safety contract in the brief; emits a root-cause status, never APPROVE/BLOCK, never auto-fixes. See Investigation mode below.
  • prepr [base] [--multi] — whole-branch review before /commit-push-pr. --multi opts into multi-LENS review (see below) — the same diff judged through several specialized reviewer lenses.
  • prepr-delta [base] [--multi]since-reviewed delta of prepr: review ONLY files that are unreviewed OR changed-since-reviewed (their current git hash-object is not an approved-reviewed sha in the review ledger). Files whose hash still matches a prior approval are listed (path + sha + verdict ref) in an explicit ALREADY REVIEWED & UNCHANGED section (proof, not silent omission). If every branch file is already reviewed+unchanged, it APPROVEs without calling Codex. Use it when a prepr OVERFLOWed (huge diff) but most of the surface was already approved in earlier phases, or to re-PR after a small follow-up without re-reviewing the whole branch. Shares the budget guard + lean packet
    • OVERFLOW path with prepr; same [base] default (merge-base chain).
  • configreport the gate's effective dials + source/runtime parity. Not a gate and not a review: a read-only diagnostic that calls Codex zero times, creates no run dir, and exits 0. See below. There is no mode that writes anything outside ~/.claude/codex-gate/ — resolving a reported drift is a manual copy the owner runs, see "Syncing the drift away" below.

Read the full file on GitHub · 525 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 · 525 lines · 193 tokens per session scan A c2ba4f5ad73e

Subscribe to this mod's changes

codex-gate is a skill published in the GitHub repository Angel45604/the-foreman (2 stars, last pushed 6d ago), licensed MIT. It adds 193 tokens to every session and 11,805 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens