<- all tokdocs

Claude Code Modernization Plugin: How the Legacy Migration Works

By , founder of Mavric and Apso

View on TikTok ->

code-modernization is an official Anthropic plugin for Claude Code that analyzes a legacy codebase, documents it, and then migrates it through a staged workflow. A TikTok from @codenameposhan tours it accurately, but the plugin was added to Anthropic's repository on April 24, 2026, about five months before the video. The tour also skips /modernize-brief, the human approval step that makes the workflow controlled.

What is the code-modernization plugin?

It lives in anthropics/claude-plugins-official, Anthropic's "Official, Anthropic-managed directory of high quality Claude Code Plugins," which is Apache 2.0 licensed. The plugin manifest lists Anthropic as author, and its listing on claude.com carries an "Anthropic Verified" badge. You install it with:

/plugin install code-modernization@claude-plugins-official

The README lays out the pipeline as preflight → assess → map → extract-rules → brief → (reimagine | transform | uplift). The plugin ships 10 commands, 8 agents and 6 workflow scripts.

All 20 commits to the plugin are by one GitHub account. The first, "Add code-modernization plugin," is dated April 24, 2026, and the latest is July 9, 2026. A May 11 commit, "Harden code-modernization plugin from a real CardDemo dry run," shows it was tested against AWS CardDemo, a public COBOL credit card application AWS built to demo mainframe migration.

What each command does

  • /modernize-preflight asks five questions the code cannot answer (scope, whether you can build and test locally, build infrastructure, past attempts, and what is off limits), then checks tests, telemetry, version history and tooling.
  • /modernize-assess runs background agents for a domain map, a technical debt scan and a security scan.
  • /modernize-map builds an interactive TOPOLOGY.html of modules, data stores and the calls between them.
  • /modernize-extract-rules turns calculations, validations and state changes into Given/When/Then "Rule Cards" with file:line citations, written to BUSINESS_RULES.md and DATA_OBJECTS.md.
  • /modernize-brief turns the discovery output into a phased plan, refuses to run if any discovery artifact is missing, and enters plan mode for human approval.
  • /modernize-reimagine, /modernize-transform and /modernize-uplift are the three build methods.
  • /modernize-harden runs a security pass on the legacy system and writes a patch for you to apply. It never edits the legacy code.

The video covers preflight, assess and map, then jumps to the build methods. The README says the build commands read the brief and treat each phase's entry criteria as gates, so editing the brief steers the migration. That is the control the video's "controlled workflow" claim depends on.

How to keep the legacy code safe

The README recommends a .claude/settings.json that denies Edit(legacy/**) and Write(legacy/**). That setting is what actually stops Claude from changing the original code.

It also treats the analyzed code as untrusted input, because a hostile codebase can plant comments like "ignore previous instructions" to steer what ends up in BUSINESS_RULES.md. Discovered credentials are masked (for example AKIA****) and kept in a gitignored SECRETS.local.md. The README advises anyone who ran an early version on a real system to check whether analysis/ files were committed and to rotate anything exposed.

What the demo found

The demo app is a calculator implemented three times: an HTML and ES5 page, a Java file, and a COBOL-85 program, sharing one history file. The assessment's main finding was that "the three implementations are not the same calculator." COBOL handles one operation per run, while Java and the browser chain operations, so 1 + 2 + 3 behaves differently by engine. COBOL writes 12.0000 + 5.0000 = 17.0000 and Java writes 9 + 9 = 18, and both formats are already mixed in the live history file.

It also found a real bug: COBOL writes overflowed results to the history as 0.0000 with no marker. The security scan found only five low-severity issues around the shared file.

The assessment recommended /modernize-reimagine. The operator then typed "modernize the app now" in plain English, and Claude built a TypeScript monorepo with tests growing from 13 to 67 passing. The run took 14 minutes 39 seconds and 64.8k tokens, running Claude Code v2.1.266 with Opus 5.

Is the COCOMO estimate accurate?

The assess step prints COCOMO-II index: KSLOC 1.446 → 2.94 × 1.446^1.10 = 4.41. The constants match the COCOMO II.2000 model (A = 2.94, nominal exponent 1.0997), and the arithmetic is right.

The size input counts all 1,446 physical lines, including blanks and comments. COCOMO II defines size in logical source statements, which exclude both. Using the 1,187 code-only lines gives 3.55, about 24 percent lower. The README says the figure is only a relative complexity index for ranking systems, never a timeline or cost, and a June 9 commit is titled "COCOMO is a complexity index, never a modernization timeline."

Should you uplift to .NET 8?

The video repeats the README's example of using /modernize-uplift to move from .NET Framework 4.8 to .NET 8. Microsoft's support policy ends .NET 8 support on November 10, 2026. .NET 10 shipped on November 11, 2025 as the current LTS release, supported through November 14, 2028. Target .NET 10 for a new uplift.

What is DevSwarm?

The demo runs inside DevSwarm, from 21st Idea, Inc., which runs branches in parallel using git worktrees. It has a free ad-supported tier, Pro at $8 a month and Team at $18 a month. Its pricing page advertises 19 coding agents, and the agent panel in the video lists 8 installed and 11 not installed, which is 19.

Bottom line

code-modernization is a real, Anthropic-built plugin that has been available since April 2026. Run the full pipeline, including /modernize-brief for approval, and add the deny rules for legacy/** before you trust it with a real system. Treat the COCOMO number as a ranking index, and target .NET 10 rather than .NET 8.

Sources

Published September 13, 2026. Based on a TikTok by @codenameposhan. Full video notes (markdown)