modernize-preflight

modernize-preflight is a command for Claude Code from anthropics/claude-plugins-official. It costs 16 tokens per session (3,013 once invoked), scanned A, original, Apache-2.0.

A command that checks whether an environment is ready to analyze and modernize an old software system. It examines analysis tools, build tools, source completeness, telemetry access, and other prerequisites, while also collecting answers from a human who knows the system.

In plain words
What is it for?
Use it before a modernization project to create a complete readiness report and identify what must be fixed before analysis, testing, dependency mapping, or transformation.
Why use it?
It finds missing tools, incomplete source code, and other readiness problems before later modernization work fails or produces unreliable results.

Command for Claude Code ✓ vendor

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

Part of the code-modernization plugin — 10 commands, 8 agents shipped together

Good fit Use it before a modernization project to create a complete readiness report…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/anthropics/claude-plugins-official/modernize-preflight
About the project

Claude Code Plugins Directory is a marketplace containing plugins for Claude Code, including tools, commands, skills, agents, hooks, and model context servers. Claude Code users browse it to install Anthropic-maintained or approved third-party extensions.

anthropics/claude-plugins-official · 35,945 stars · on GitHub · code.claude.com

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.

Clone the repo
git clone --depth 1 https://github.com/anthropics/claude-plugins-official

Made for: Claude Code.

Or install code-modernization, the plugin that ships this one along with the rest of its 10 commands, 8 agents.

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 modernize-preflight

README.md
[![agentmods](https://agentmods.dev/badge/commands/anthropics/claude-plugins-official/modernize-preflight.svg)](https://agentmods.dev/commands/anthropics/claude-plugins-official/modernize-preflight)
Your own site
<a href="https://agentmods.dev/commands/anthropics/claude-plugins-official/modernize-preflight"><img src="https://agentmods.dev/badge/commands/anthropics/claude-plugins-official/modernize-preflight.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,013 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.00016 $0.03013
Opus 5 $0.00008 $0.01507
Sonnet 5 $0.00003 $0.00603
Haiku 4.5 $0.00002 $0.00301

Measured 7d ago against content hash 50324049bc37, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

modernize-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 7d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/code-modernization/commands/modernize-preflight.md · 227 lines

How it starts

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

Check whether this environment is ready to analyze — and eventually transform — legacy/$1, and tell the user exactly what to fix before the other commands run into it. Modernization sessions fail late and confusingly when this isn't done: assessment metrics silently degrade without analysis tools, characterization tests can't run without a build toolchain, and dependency maps come out wrong when half the source isn't in the tree.

Run every check even when an early one fails — the point is one complete readiness report, not the first error.

Check 0 — Ask the human (these answers are not in the source)

Before any automated check, ask the person running this command the five questions below. The most expensive modernization mistakes are things a person who knows the system answers in seconds and that cost real money to discover wrong from the source alone. Ask only these — add none — and accept "don't know" for any of them.

Ask, then do not block on the answers. None of Checks 1–6 needs one (Check 6 verifies the scope boundary from the source independently — the human's answer says whether a crossing matters, not whether it exists), so proceed to the checks immediately after asking and write the report with whatever answers exist by then. Any question still unanswered goes in the report verbatim, marked as an open item the human must fill in — it is not dropped. This way an interactive user answers while the checks run, a headless or scripted run still produces a complete PREFLIGHT.md, and the one thing that never happens is a readiness report silently missing the questions.

  1. Scope — Is legacy/$1 the complete system, or one slice of a larger codebase? If a slice: what outside it depends on code inside it, and is breaking those consumers acceptable? (Check 6 verifies this from the source independently; the human's answer says whether it matters.)
  2. Build & test locally — Can this environment restore, build, and run the tests? Roughly how long does the full CI pipeline take? (A pipeline measured in hours changes the whole validation strategy: you cannot afford to first learn you were wrong from CI.)
  3. Bespoke build infrastructure — Is there organization-specific build or dependency-resolution machinery (an internal package feed, a custom binary store, a code generator, a wrapper around the standard build tool) that someone new to this codebase would not guess? Where is it documented?
  4. Prior attempts — Has anyone tried to modernize any of this before? What went wrong?
  5. Off limits — Is anything under legacy/$1 not allowed to change in this pass (a component another team owns, a frozen branch, generated code)?

Record every answer verbatim in the report — downstream commands, and /modernize-brief most of all, read them from there. Do not paraphrase away a caveat the human gave you.

Read the full file on GitHub · 227 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. 7d ago First seen · 227 lines · 16 tokens per session scan A 50324049bc37

Subscribe to this mod's changes

modernize-preflight is a command published in the GitHub repository anthropics/claude-plugins-official (35,945 stars, last pushed yesterday), licensed Apache-2.0. It adds 16 tokens to every session and 3,013 once invoked, about $0.0001 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-30.