modernize-preflight

modernize-preflight is a command for Claude Code from anthropics/claude-plugins-official. It costs 23 tokens per session (3,159 once invoked), scanned B, 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: reads .claude/ paths; names the AskUserQuestion tool.

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

Good fit 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.

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 · 44,566 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 13 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/github.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/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 modernize-preflight

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 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,159 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00023 $0.03159
Opus 5.5 $0.00009 $0.01264
Sonnet 5.5 $0.00005 $0.00632
Haiku 4.5 $0.00002 $0.00316

Measured 1mo ago against content hash ba85391e98e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

modernize-preflight scanned grade B 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 1mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

(`~/.claude/settings.json`, or `settings.json` in `CLAUDE_CONFIG_DIR`).
Origin

Copies of this mod

2 near-identical copies found in the catalogue:

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

How it starts

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

Check whether this environment can analyze — and eventually modernize — the system $system, and tell the user exactly what to fix before the other commands run into it. Modernization runs fail late and confusingly when this is skipped: metrics silently degrade without analysis tools, 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.

Where the code lives

The code is legacy/$system: a copy, or a symlink to where it really lives (how a large repository stays put). Nothing is ever copied for you.

  • If $ARGUMENTS contains --source <path> (a directory, absolute or relative), check that it exists and is not the filesystem root or the user's home directory, then, only if legacy/$system does not exist yet, create the link: mkdir -p legacy && ln -s <absolute path> legacy/$system (on Windows a junction: cmd /c mklink /J legacy\$system <absolute path>). If legacy/$system already exists and points elsewhere, say so and change nothing.
  • Say where legacy/$system points (readlink legacy/$system, or "a directory in this workspace") in one line before you start.
  • If $target_stack starts with --, it is a flag, not a stack.

Never modify anything under legacy/$system.

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

The most expensive modernization mistakes are things a person who knows the system answers in seconds. Ask only the five questions below — add none — and accept "don't know" for any of them.

Ask with the AskUserQuestion tool (a pop-up), never in chat text. It takes at most four questions per call: ask 1–4 in one call and 5 in a second. Give each question its own options, one of them "Don't know", and let the person type an answer instead. Do not print the questions in your reply and do not answer them yourself. While the pop-up is open, run the other checks — none of them needs the answers.

Read the full file on GitHub · 223 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. 1mo ago Changed · -4 lines · +7 tokens per session scan A → B ba85391e98e4
  2. 1mo 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 (44,566 stars, last pushed yesterday), licensed Apache-2.0. It adds 23 tokens to every session and 3,159 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.