30 November 2026

Life after migrating a legacy .NET app with Claude Code

What happens after the migration is done, the tests are green, and the new system has to face real players?

In my previous article, I went through how I migrated a legacy .NET Core 3.1 application to .NET 10 with Claude Code. It ended with a list of next steps. So, did they happen? What came after them? What have I learned this time?

This article will go through everything that was done after the initial migration: the switch over, going live, the new features, what went wrong, and where things stand today.

Where we left off

The product

A quick reminder for those who didn’t read the first article: Kings Of Chaos (KoC) is a browser game. The statistics platform saves every action taken in the game and exposes them through an API, a web application, and a Discord bot that players use in their own servers.

The migration

The legacy system was a .NET Core 3.1 that started as a proof of concept that kept growing for years, with no documentation and no tests. With Claude Code, it was migrated to .NET 10 with domain-driven design, orchestrated by Aspire, one action at a time:

That took around 31 sessions over 5 days.

The next steps

The previous article ended with four next steps:

Here’s a map of the seven weeks that followed:

A timeline of the seven weeks after the first article, from 10 October to 25 November

Let’s see what happened to each of them first, and then everything that came after.

What happened to the next steps?

Full documentation

This one was done first, the day after the article was published. Claude generated the technical documentation, and a user help file per application: the Discord bot, the public website, and the staff website. A fifth file came later with the Android app (more on that below).

Generating them once wasn’t the hard part. Keeping them correct was. So it became a hard rule in CLAUDE.md, and part of the definition of done of every change:

Today, these five files hold close to 100,000 words. The technical documentation alone is around 33,000. Nobody, me included, would have written that by hand for a side project.

Switch over

The cutover questions

I didn’t want Claude to decide on its own how the legacy code leaves the repository. So the trigger for the cutover in CLAUDE.md forced it to ask me first:

“do the cutover” Only after rows 9a to 9v are Done (D27, D30, D31, D32, D33, D35); if not, say which is missing. Status row 10, playbook → “Cutover”. First ask the owner the mandatory cutover questions with AskUserQuestion (repo layout v2/ vs root, timing/era-reset done, legacy removal in git) before any change; never assume answers.

The answers went into the decisions file, like everything else:

# Decision Notes
D36 Cutover repo clean-up (owner answers, 2026-10-14; Q5 answered): the code stays in v2/ (not promoted to the root); the end-of-era window has not started, so only the repo work and the guide are done; legacy is tagged legacy-final (local annotated tag on 8dd07cb) and then deleted from the working tree, with the old solution, the stale dotnet.yml workflow and the legacy-guard hook. Answers D16’s questions. The tag must be pushed by the owner to be a durable restore point; v1 rollback uses the already-deployed v1 binaries or a checkout of the tag.

Numbers

The previous article estimated:

The actual commit removed 232,149 lines in 641 files. The extra files were the old solution, the stale CI pipeline and the hook. Not bad for an estimate.

The guard-legacy.sh hook went with them, since there was no legacy code left to guard. If I ever need to read the old code, it’s one git show legacy-final:<path> away.

Going live

The first release was deployed to my server on the 25th of October. On the 31st, the workers were pointed at the live game.

UAT testing

Before every release, I tested locally with the Aspire AppHost and a beta Discord bot, exactly like during the migration. But the real UAT started when actual players used the system:

I’ll go through the details in “What went wrong” below. Testing didn’t end at a phase. It moved to production, and the feedback kept coming.

Numbers comparison

This was the step I was most worried about, since all the tests were written by the same AI.

I build a simple console tool to copy the data from the old system to the new system, but only on my local machine. Its second job was the comparison: a verify command compares the totals of both systems over the same range of ids, and then a random sample of reports, field by field.

It can only SELECT from the legacy database, and it refuses to write to a database that isn’t on my machine. Production still imports nothing from the legacy database.

The comparison taught me something I didn’t expect: not every difference is a bug in the new code.

When the old system has no tests either, a difference means “look at both”, not “fix the new one”.

What came next

Going live

Releases

I didn’t want a push to main to deploy anything. So the rule became: a deploy happens only when a GitHub release is published.

A GitHub Actions workflow, running on a self-hosted runner on my server, builds every component with the release version, deploys the API and the two websites to IIS, deploys the workers and the bot as Windows services, and checks that the API reports the new version. The staff app got a Versions page, and the bot posts in Discord when it comes online and when it goes offline.

At first, one tag was the version of all five components. A week later, I changed that: each component now has its own version, and the release drafts are generated automatically.

The Android app has its own releases, with a mobile- tag that the server deploy ignores. Its own workflow builds, tests, signs and scans the app, and attaches it to the release. Uploading it to Google Play is still a manual step.

A diagram of the release pipeline: a push to main, CI and a draft release per component, I publish the draft, the deploy workflow on my server deploys to IIS and Windows services; the Android app is built and attached to its own release, then uploaded to Google Play

Since 25 October, that workflow has deployed 62 releases successfully.

No change may delete data

Once everything was deployed, the most important rule of the project changed. During the migration, it was “never edit the legacy code”. Now that v2 holds real data, it became:

Since then, 12 database migrations were added. None of them drops, renames or alters anything.

Backfilling from KoC

When KoC started sending new fields, like the sabber’s own losses and the weapons revealed by a recon, the old reports had to be fetched again to fill them. Since nothing may be deleted, a new column means a new backfill loop, with its progress and a Stop/Start button on the staff app, not a rebuilt table.

Monitoring

I added Grafana Cloud through OpenTelemetry, first on the workers, then on all five processes, with a dashboard of 43 panels. It came with three surprises:

New functionalities

The Android app

The biggest addition was a native Android app for players, and built with .NET MAUI so it can reuse the same contracts as the website and the bot.

The main decisions:

I used the same recipe as the migration: a spec file, a new skill (build-mobile-app), phases M0 to M12, and a ready prompt for each phase. One phase per session. For example:

do M0
Build phase M0 of the Android app (v2/docs/mobile-app.md): the KoC.Mobile.slnx with Core, the MAUI app and the tests, the rules tests, the first screen that calls the API status, and the package and chart-library choice. Do not touch KoC.slnx. Verify package versions on NuGet, ask me to approve each package before using it, and tell me what I must install on my machine if the MAUI Android workload is missing.

Phases M0 to M11 were built in three days, from 31 October to 2 November. The app went to closed testing on Google Play on 2 November, and it has had 11 tagged releases since.

For the players

For the alliances: an API

Some alliances wanted to use the statistics in their own tools. So each alliance can now get its own API key: one owner, one key, only its hash stored, and a key is suspended rather than deleted.

The alliance API has 24 routes: the alliance’s own logs, the era-wide statistics, and the latest figures per player from the alliance’s own recons. Requests are rate-limited per alliance, and every answer carries rate-limit headers. That last one also came from an alliance’s feedback.

A new hard rule in CLAUDE.md keeps an Insomnia collection of the alliance API current in the same change, so an alliance can import it and start right away.

What went wrong

During the migration, everything was green and some of it still didn’t work. After going live, the same thing happened. This time, real systems were the ones telling me.

Discord. The bot settings page listed only the servers that the visitor owns, not the ones they manage. The tests passed against a scripted Discord. The real one, called through an unversioned endpoint, answered with an old API version where the permissions are a number. Claude first added logs that only counted the servers, without names or ids, and once we read them, the fix was easy.

Google Play. The Play Console said the privacy policy page was “not found”. It worked fine in a browser, but Blazor answered HEAD requests with a 405. Then Play’s pre-launch report suggested enabling R8 code shrinking. The release build then crashed at start, because R8 removed a class it needed, until keep rules were added.

The app. It froze when choosing a list, because a picker was redrawn about six times inside its own callback. Another screen went blank because the work resumed on a background thread instead of the UI thread.

The alliance API. A recon field was documented as a name, but it was sent as a number. Fixing it would have broken the website, the bot, and the apps already installed, so a fieldName was added next to it.

Cloud sessions. They had no .NET SDK and no Docker, so they couldn’t build or run anything. One of their pull requests failed CI on an analyzer error. A session that can’t build can’t verify.

The code review agent also earned its place again. It found that the HTTP client logging was writing the players’ unique ids, which are part of some URLs and the key to a player’s personal statistics, to the logs. That logging was removed everywhere, and a test now pins the log level.

My conclusion this time: tests written against a fake Discord, a fake Google Play, or an imagined integration tell you the code works with what the AI imagined. Only the real thing tells you if it works.

Numbers

Around 80 working sessions, plus a few short ones, from 11 October to 26 November, on 28 different days.
84 commits. The git diff since the first article shows +141,963 lines added and 1,859 removed in the new code and its docs. Around 45,000 lines of C# and XAML are the Android app.
The number of test methods went from 3,750 to 6,497.
30 new owner decisions (D36 to D65), and 60 new technical decisions (T118 to T177).
12 new database migrations, all additive.
62 successful deployments, and 11 Android releases.
The documentation went from 660 KB to 1.9 MB.

The design today

A diagram showing how the system looks today, with the Android app, the alliance tools, Grafana Cloud and the read-only access to the game database in green

Everything in green is new since the first article.
The Android app uses the same API as the website and the bot, with no key of its own.
Alliances use their own tools, with their own key.
The API reads some of the game’s own logs, live and read-only.
All five processes send their telemetry to Grafana Cloud.
The rest didn’t change: the game still doesn’t call my server after each action, and the workers still fetch everything from KoC.

Next steps?

Enforce the new rule

“No change may delete data” only exists as text today. As I said in the first article, rules should be enforced, not only stated. It should be a test that fails the build when a migration drops, renames or alters anything.

Clean up the context

The status and decisions files grew too big, and some statements in them went stale. More on that below.

What I learned along the way

Going live changes the rules

During the migration, the most important rule was to never touch the legacy code, and a hook enforced it. After going live, the legacy code was gone, and the most important rule became to never destroy real data.

The hook was removed with the legacy code. The new rule lives in CLAUDE.md and in Claude’s memory. So far, every migration has followed it, but that’s the rule being followed, not enforced. That’s the next guardrail.

Context grows

In the first article, I said that AI doesn’t need a better prompt, it needs a better memory. Seven weeks later, the memory itself became the problem.

The status file is 249 KB, and the decisions file is 447 KB. Both more than doubled since the first article:

A bar chart: status.md grew from 116 KB on 10 October to 249 KB on 30 November, and decisions.md from 206 KB to 447 KB

Neither of them can be read by Claude in one go anymore, even though the session start protocol tells it to read both first. A session now has to search them, or send a sub-agent to read them. The decisions file also collected some bookkeeping mistakes, such as two rows with the same decision number.

Memory needs maintenance too: archive what’s done, keep the current state short, and keep the history somewhere it can be searched rather than read from top to bottom.

Context still goes stale

A wrong note is worse than a missing one, because Claude will trust it. I wrote that in the first article, and my own docs proved it. After 62 deployments through GitHub Actions, the deployment guide still says that the automated update through GitHub Actions has not been run on the real server yet, and the technical documentation still says “Cutover not done”.

The rule to keep the docs current was there. But it’s triggered by a change in the code, and a deployment isn’t a change in the code. Events that happen outside the repository need someone to write them down.

Decisions need reasons, so they can be reversed

Some decisions were reversed after going live:

Because each decision had its reason written next to it, reversing one was a conscious choice, not an accident. And when Claude had to assume something I hadn’t decided, it wrote it down in a “Not decided, assumed by Claude” section, so I could review it.

Make the AI say what it didn’t verify

Many status entries end with lines like “Not seen in a browser” or “not tried against the real Discord”. I learned to read those first. The Discord bug above was on one of those lines.

Real users are the best testers

A player’s review, Google Play’s pre-launch report, and an alliance integrating with the API found more real issues than any additional test. Put the system in front of real people as early as you can.

The recipe is reusable

The Android app is a new project, on a new platform, in the same repository. It used the same recipe as the migration: a spec, a skill, phases, a prompt per phase, and rules in CLAUDE.md. That’s why most of it was built in three days.

A reusable recipe

The recipe from the first article still holds. After the migration, I’d add these steps:

Final thoughts

Seven weeks after the first article, the new system is live, the legacy code is gone, players have an Android app, and alliances build their own tools on top of an API. Most of that wasn’t even part of the plan. With Claude doing the heavy lifting, the bottleneck was no longer the time it takes to write code, but the time it takes to decide and to verify.

The code still isn’t mine the way the legacy code was. But the product is, and so are the decisions, the rules, and the responsibility for whatever ships. Treat AI as a tool, keep its memory clean, and test the real thing.

tags: ai - claude-code - agentic-development - dotnet - csharp - legacy-migration - domain-driven-design - dotnet-maui - technical-debt