preflight

preflight is a skill for Claude Code, Codex from anhnguyen0905/codex-mcp. It costs 65 tokens per session (2,631 once invoked), scanned A, original, MIT.

A startup checklist for a multi-stage coding workflow called codex-flow. It checks account health, interrupted work, Git state, ignored files, and existing test failures.

In plain words
What is it for?
Use it before planning or implementing changes in a repository managed by codex-flow.
Why use it?
It creates a known starting point and prevents later work from being confused with problems that were already present.

Skill for Claude CodeCodex

Written for Claude Code and Codex: ${CLAUDE_PLUGIN_ROOT} variable, but also runs codex exec. Also seen: mentions Codex.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the codex-flow plugin — 61 skills, 1 command, 1 MCP server shipped together

Good fit Use it before planning or implementing changes in a repository managed by codex-flow.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add anhnguyen0905/codex-mcp
Claude Code
/plugin install codex-flow

Made for: Claude Code, Codex.

Or install codex-flow, the plugin that ships this one along with the rest of its 61 skills, 1 command, 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 preflight

README.md
[![agentmods](https://agentmods.dev/badge/skills/anhnguyen0905/codex-mcp/preflight/github.svg)](https://agentmods.dev/skills/anhnguyen0905/codex-mcp/preflight)
Your own site
<a href="https://agentmods.dev/skills/anhnguyen0905/codex-mcp/preflight"><img src="https://agentmods.dev/badge/skills/anhnguyen0905/codex-mcp/preflight/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for preflight

Your own site · 80×15
<a href="https://agentmods.dev/skills/anhnguyen0905/codex-mcp/preflight"><img src="https://agentmods.dev/badge/skills/anhnguyen0905/codex-mcp/preflight.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,631 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00065 $0.02631
Opus 5 $0.00032 $0.01316
Sonnet 5 $0.00013 $0.00526
Haiku 4.5 $0.00006 $0.00263

Measured today against content hash 59a619f986a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

preflight scanned grade A with 0 findings 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 today.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/preflight/SKILL.md · 154 lines

How it starts

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

Preflight (Phase 0 — run FIRST, it is a gate)

Nothing downstream is safe until these pass. Do not interview, plan, or execute until the gate is green.

Step 1 — Health gate

Call mcp__codex__codex_health with { deep: true } ONCE before anything else. The deep input adds a one-shot read-only codex exec probe and returns execProbe (ok | quota | model | error | skipped) plus execProbeMessage next to loggedIn; read execProbe from that single call instead of re-probing later phases.

  • Tool call fails / server missing → the MCP server isn't set up. Point the user to the codex-mcp README install steps (or node scripts/doctor.mjs), then offer the command's Executor fallback: fix and re-check, or continue with Claude as executor. Never continue silently.
  • loggedIn: false → tell the user to run codex login (ChatGPT Plus/Pro/Team, or set OPENAI_API_KEY), then offer the same Executor fallback choice. Proceed only after a re-check shows loggedIn: true or the user explicitly chose the fallback.
  • execProbe: quota or execProbe: model → logged in but unable to execute. Quote execProbeMessage and offer the Executor fallback right away; a quota or model probe result is sufficient on its own and requires NO unhealthy health re-check.
  • execProbe: error → report execProbeMessage verbatim, then offer the same fallback choice.
  • loggedIn: true with execProbe: ok (or skipped) → report the Codex version, record executor: codex, and continue.
  • The analysis lane of the Fast-path gate needs no Codex session and no fallback decision; when its optional Codex second opinion fails, the analysis is delivered Claude-only with the failure named in the "what I verified" note.

Step 2 — Resume check (don't clobber an interrupted run)

If .codex-flow/STATE.md exists, treat it as an interrupted run even when PLAN.md or TASKS.md has not been created yet:

  • Read .codex-flow/STATE.md as the resume authority. Its approval fields decide which phases may be skipped; any phase whose approval is not recorded MUST be re-run. The existence of PLAN.md/TASKS.md is NOT proof of approval.
  • When both .codex-flow/PLAN.md and .codex-flow/TASKS.md exist, run node "${CLAUDE_PLUGIN_ROOT}/scripts/context-slice.mjs" --resume and read .codex-flow/RESUME.md instead of the raw files. If the helper is unavailable in a standalone install, fall back to reading PLAN.md and TASKS.md directly. If the helper is present but exits non-zero, surface the error to the user and STOP; never use the standalone fallback for a failing helper. When either file does not exist, read only the control files that exist; do not require a missing TASKS.md to resume an earlier phase.
  • When TASKS.md exists, show its task Statuses. Ask resume vs restart in every case except phase: complete, which archives and starts fresh without a resume offer (see below).
  • Before scheduling anything, reconcile every task whose Status is in-progress. Read its recorded Session line. The resume slice's Task statuses section carries Session content for every in-progress task even though it embeds the full task text only for the first unfinished task; do not assume the other in-progress task blocks are embedded. A launching line may be sequential (- Session: launching (base: <short sha>)) or parallel (- Session: launching (base: <short sha>, worktree: <path>, branch: <name>)). Extract the base sha from either launching form or the completed-session form. Then cross-check git log --oneline <base sha>..HEAD and git status for changes to the task's declared Files: since that base. Report the evidence and ask the user to choose exactly one: continue in the recorded session (when a real session id exists) / review the work as-is / reset to pending. For reset to pending, roll back through the checkpoint commit when checkpointCommits is enabled. Never blindly re-execute an in-progress task.
  • phase: complete → terminal, not resumable. Do NOT offer resume: archive the run's control files to .codex-flow/archive/<timestamp>/ and begin fresh, exactly as Restart does. Resume is offered only for a non-complete phase.
  • Resume → first run node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" check, adding --tasks .codex-flow/TASKS.md whenever that file exists so the terminal-status validation runs (node "${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.mjs" check --tasks .codex-flow/TASKS.md); when it reports only missing keys on a legacy file, add them with set (currentTask -, taskStage idle, wave -) and continue; any other violation is surfaced to the user before routing. Then skip only the phases whose approvals STATE.md records, and route from STATE.md's recorded phase. For phase: execution, enter Phase 4 at the first task not marked done. Before that, first route by taskStage regardless of currentTask (currentTask names the task in sequential mode; in parallel mode it is - and wave names the wave): reviewing → resume Phase 5 for that task; launching or executing → run the in-progress reconciliation above before anything else; handoff → finish Phase 5 step 7's durable handoff (or the wave's Step 3.8); merge-conflict → surface the conflict to the user and STOP; idle → the next pending task. For phase: review, resume Phase 5 completion work; when all tasks are done but phase is not complete, also resume Phase 5 for the final dual review, requirement ID-walk, improvement gate, cost/report delivery gates, and completion write instead of concluding there is no work. For an earlier phase, enter its first unapproved gate. Treat every [verify] block as a hypothesis: confirm it against git diff and the current code before relying on it. Record the current git rev-parse HEAD as resumeHead and update phase; apart from the legacy-key backfill above, change no other STATE.md key as part of the resume operation. The reconciliation choice for an in-progress task (continue / review as-is / reset) is made first; the taskStage routing then applies to the task as the user left it.
  • On resume, reuse the report dir recorded under ## Session report in PLAN.md; create it only if missing.
  • Restart → archive the old control files that exist to .codex-flow/archive/<timestamp>/, then begin fresh.

Read the full file on GitHub · 154 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. today Changed · +16 lines 59a619f986a2
  2. 5d ago Changed · +31 lines 8f7263109212
  3. 9d ago First seen · 107 lines · 65 tokens per session scan A f6a333e7fc54

Subscribe to this mod's changes

preflight is a skill published in the GitHub repository anhnguyen0905/codex-mcp (3 stars, last pushed today), licensed MIT. It adds 65 tokens to every session and 2,631 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. 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

prowler-commit

Creates professional git commits following conventional-commits format. Trigger: When creating commits, after completing code changes, when user asks to commit.

prowler-cloud/prowler · 33 tokens

gh-auth-isolation

Safely manage multiple GitHub identities (EMU + personal) in agent workflows.

github/gh-aw · 20 tokens

comet-github

A routing guide for Comet-related GitHub work. It directs requests about pull requests, issues, CI failures, ideas, and fixes to the appropriate review or implementation process.

rpamis/comet · 72 tokens

github-skill

Work with GitHub via the gh CLI — clone repositories, create/list/merge pull requests, create/list issues, and run any other gh command (API calls, workflow runs, releases, repo administration). List operations return parsed JSON.

zeenie-ai/OpenCompany · 51 tokens

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

nvca-chart-release

Release NVCA Operator chart changes from the native monorepo source to the vendored Helm chart. Use when updating the vendored NVCA Operator chart, changing NVCA image refs, publishing helm-nvca-operator, or validating the chart against a self-managed control plane.

NVIDIA/nvcf · 61 tokens