modernize-map

modernize-map is a command for coding agents from anthropics/claude-plugins-official. It costs 19 tokens per session (2,188 once invoked), scanned A, original, Apache-2.0.

A command that maps how an old software system is connected. It traces calls between programs, data movement, storage, batch jobs, deployment settings, and other relationships, then renders the results as diagrams.

In plain words
What is it for?
Use it to build call graphs, data-lineage maps, batch-flow views, and navigable diagrams before changing a legacy system.
Why use it?
It exposes hidden dependencies and entry points that are easy to miss when reading files one at a time.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

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

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,867 stars · on GitHub

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/anthropics/claude-plugins-official/modernize-map
Clone the repo
git clone --depth 1 https://github.com/anthropics/claude-plugins-official

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/anthropics/claude-plugins-official/modernize-map.svg)](https://agentmods.dev/commands/anthropics/claude-plugins-official/modernize-map)
Your own site
<a href="https://agentmods.dev/commands/anthropics/claude-plugins-official/modernize-map"><img src="https://agentmods.dev/badge/commands/anthropics/claude-plugins-official/modernize-map.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,188 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 $0.00019 $0.02188
Opus 5 $0.00010 $0.01094
Sonnet 5 $0.00004 $0.00438
Haiku 4.5 $0.00002 $0.00219

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

Security

Grade A, and why

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

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/code-modernization/commands/modernize-map.md · 185 lines

How it starts

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

Build a dependency and topology map of legacy/$1 and render it visually.

The assessment gave us domains. Now go one level deeper: how do the pieces connect? This is the map an engineer needs before touching anything.

What to produce

Write a one-off analysis script (Python or shell — your choice) that parses the source under legacy/$1 and extracts the four datasets below. Three principles apply across stacks; getting them wrong produces a misleading map:

  1. Edges live in two places — direct calls in source, and dispatcher/ router calls whose targets are variables (config tables, route maps, dependency injection, dynamic dispatch). Resolve variables against config before declaring an edge unresolvable.
  2. The code↔storage join is usually external configuration, not source — job/deployment descriptors map logical names to physical stores.
  3. Entry points usually live in deployment config, not source — without parsing it, every top-level module looks unreachable.

Extract:

  • Program/module call graph — direct calls (CALL, method invocations, import/require) and dispatcher calls (EXEC CICS LINK/XCTL, DI container wiring, framework routing, reflection/factory). Resolve variable call targets against route tables, copybooks, config, or constant pools.
  • Data dependency graph — which modules read/write which data stores, joined through the relevant config: SELECT…ASSIGN TO ↔ JCL DD (batch COBOL), EXEC CICS READ/WRITE…FILE() ↔ CSD DEFINE FILE (CICS online), EXEC SQL table refs (embedded SQL), ORM annotations/mappings (Java/.NET), model files (Node/Python/Ruby). Include UI/screen bindings (BMS maps, JSPs, templates) — they're dependencies too.
  • Entry points — whatever the stack's outermost invoker is, read from where it's defined: JCL EXEC PGM= and CICS CSD DEFINE TRANSACTION (mainframe), web.xml/route annotations/route files (web), main()/argv parsing (CLI), queue/scheduler subscriptions (event-driven).
  • Dead-end candidates — modules with no inbound edges. Only meaningful once all the entry-point and call-edge types above are in the graph. Suppress the dead claim for anything that could be the target of an unresolved dynamic call. A grep-only graph will mark most dispatcher-driven modules (CICS programs, Spring controllers, ORM-bound DAOs) dead when they aren't.

If the source is fixed-column (COBOL columns 8–72, RPG, etc.), slice the code area and strip comment lines before regex matching, or you'll match sequence numbers and commented-out code.

Save the script as analysis/$1/extract_topology.py (or .sh) so it can be re-run and audited. Have it write a machine-readable analysis/$1/topology.json and print a human summary. Run it; show the summary (cap at ~200 lines for very large estates).

topology.json must follow this schema — it feeds the interactive viewer:

{
  "system": "<display name>",
  "root": {
    "id": "sys", "name": "<system>", "kind": "system",
    "children": [
      { "id": "dom:<domain>", "name": "<Domain>", "kind": "domain",
        "children": [
          { "id": "<MODULE>", "name": "<MODULE>", "kind": "module",
            "language": "cobol", "loc": 1234, "file": "src/MODULE.cbl" }
        ] },
      { "id": "dom:data", "name": "Data stores", "kind": "domain",
        "children": [
          { "id": "ds:<NAME>", "name": "<NAME>", "kind": "datastore" }
        ] }
    ]
  },
  "edges": [
    { "source": "<id>", "target": "<id>", "kind": "call" }
  ],
  "entryPoints": ["<id>", "..."],
  "deadEnds": ["<id>", "..."],
  "observations": ["<architect observation>", "..."],
  "flows": [
    { "name": "<business flow>", "persona": "<who experiences it>",
      "description": "<one sentence, plain language>",
      "steps": [
        { "label": "<business-language step>", "nodes": ["<id>", "<id>"] }
      ] }
  ]
}
  • Group leaf modules under domain containers (use the domains from /modernize-assess if available). Leaf kinds: module, datastore, job, screen. loc drives circle size — include it for modules.
  • Edge kinds: call (direct), dispatch (dynamic/router), read, write. Every edge endpoint must be a leaf id that exists in the tree.
  • deadEnds: the dead-end candidates from the extraction, rendered with a dashed outline in the viewer. Apply the suppression rules above — anything that could be the target of an unresolved dynamic call does NOT belong here; record that uncertainty in observations instead.
  • Datastore ids and names must be logical identifiers — DD name, dataset name, table/schema name, at most host:port. If the resolved config value is a URL or DSN, strip userinfo and credential query params before it goes anywhere in topology.json: the file gets committed and the viewer displays names verbatim. Never copy raw config values into observations.
  • observations: 3–7 architect observations — tight coupling clusters, single points of failure, service-extraction candidates, data stores with too many writers, dispatch targets the extraction could not resolve.
  • flows is the persona walkthrough section — see below.

Read the full file on GitHub · 185 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 · 185 lines · 19 tokens per session scan A aa85a1f441cc

Subscribe to this mod's changes

modernize-map is a command published in the GitHub repository anthropics/claude-plugins-official (35,867 stars, last pushed yesterday), licensed Apache-2.0. It adds 19 tokens to every session and 2,188 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.