preflight

preflight is a command for Claude Code from s977043/river-review. It costs 36 tokens per session (1,584 once invoked), scanned A, original, MIT.

A pre-work check for finding whether a coding task or pull request is already finished, obsolete, or being handled elsewhere. A pull request is a proposed change to a code repository.

In plain words
What is it for?
Use it before multi-pull-request merges, handoffs, new pull requests, main-branch fixes, or changes to shared CI settings.
Why use it?
It reduces duplicated work and helps avoid conflicts with other changes, especially before merging or opening pull requests.

Command for Claude Code

Part of the river-review plugin — 140 skills, 15 commands, 5 agents, 2 hooks 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 commands/s977043/river-review/preflight
Clone the repo
git clone --depth 1 https://github.com/s977043/river-review

Made for: Claude Code.

Or install river-review, the plugin that ships this one along with the rest of its 140 skills, 15 commands, 5 agents, 2 hooks.

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/commands/s977043/river-review/preflight.svg)](https://agentmods.dev/commands/s977043/river-review/preflight)
Your own site
<a href="https://agentmods.dev/commands/s977043/river-review/preflight"><img src="https://agentmods.dev/badge/commands/s977043/river-review/preflight.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,584 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.1 $0.00036 $0.01584
Opus 5 $0.00018 $0.00792
Sonnet 5 $0.00007 $0.00317
Haiku 4.5 $0.00004 $0.00158

Measured 5d ago against content hash 468c1f32061f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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.

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.

.claude/commands/preflight.md · 127 lines

How it starts

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

作業開始前の検証: 「$ARGUMENTS」に関連するタスクが既に完了/不要/並行実施されていないか確認する。

このスキルは書き込み系ツール (Edit / Write / git commit / gh pr create) を実行する 最初の tool call の直前 に呼び出すことを想定している。抽象的な注意喚起ではなく、検証コマンドを具体的に実行して判定まで行う。

前提

以下のような作業シグナルがあれば /preflight を先に実行する:

  • 引き継ぎ情報として複数 PR のマージ指示を受けた
  • main 修正 / CI 失敗の解消タスクを開始しようとしている
  • 新しい PR を作成しようとしている
  • gh pr list の結果を信頼して作業計画を立てようとしている
  • .github/workflows/*.ymlnode-version / action pin / permissions を変更する PR を作ろうとしている(Node baseline / action version / permissions 系の並行 PR と衝突しやすい)

調査手順

Step 1. 引数からキーワードを抽出

引数から 1-3 個の検索キーワードを抽出する (例: "husky chmod" → husky, "riverbed memory v1" → riverbed, memory)。PR 番号が与えられた場合はそれを直接使う。

Step 2. main の最新状態を取得

git fetch origin main
git log origin/main --oneline -15

直近 15 コミットで関連キーワードが含まれていないか目視確認。

Step 3. 対象 PR の state を REST API で直接検証

PR 番号が指定されている場合は、1 件ずつ:

gh api repos/OWNER/REPO/pulls/{N} --jq '{number, state, merged, merged_at, mergeable, mergeable_state}'

重要: gh pr viewgh pr list は GraphQL 経路でキャッシュ遅延がある。merged: false, state: open と表示されても実際には merged の場合があるため、必ず REST API (gh api) で裏取りする。

Step 4. 並行 in-flight PR の検索

gh pr list --state open --search "<keyword>" --json number,title,headRefName,author

キーワードに該当する open PR を列挙。別の作業者/セッションが同じ問題に取り組んでいないか確認。

Step 5. 直近 close 済 PR の検索

gh pr list --state closed --search "<keyword>" --limit 5 --json number,title,mergedAt,closedAt

直近の close は「並行作業が merge された直後」の可能性が高いシグナル。5 件以内の close がヒットしたら内容を確認。

Step 6. 既存 issue / Epic の state 確認 (関連 issue 番号がある場合)

gh api repos/OWNER/REPO/issues/{N} --jq '{state, closedAt, title}'

判定

検証結果に基づいて以下のいずれかで応答する:

A. SAFE — 作業開始可能

条件:

  • 対象 PR が全て OPEN かつ未 merge
  • 類似 in-flight PR なし
  • 直近 close 済 PR に該当内容なし
  • main に関連コミットなし

対応: ユーザーに SAFE 判定を報告し、作業を開始する。

B. OBSOLETE — タスクが不要

条件:

  • 対象 PR が既に merged (REST API で確認)
  • main に同内容のコミット既に存在
  • 関連 Issue/Epic が既に CLOSED

対応:

  1. obsolete の根拠 (merge commit hash、close 日時) を提示
  2. 作業を停止し、ユーザーに「このタスクは既に完了しています」と報告
  3. ユーザーの承認なしに cleanup (close / revert 等) を実行しない

Read the full file on GitHub · 127 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. 5d ago First seen · 127 lines · 36 tokens per session scan A 468c1f32061f

Subscribe to this mod's changes

preflight is a command published in the GitHub repository s977043/river-review (3 stars, last pushed today), licensed MIT. It adds 36 tokens to every session and 1,584 once invoked, about $0.0002 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.