✓ ShippedByAgents
Practitioner (own blog/paper) Migration

Mercari engineer migrates legacy orders into the Global Foundation with Claude Code: about 9,000 lines across five services, "what normally takes weeks took days"

A Mercari backend engineer (eg01ste) describes migrating years of orders from a partially global legacy order system into Mercari's Global Foundation, a new unified platform for multiple countries. He started alone, with no experience of the legacy system, limited documentation and few engineers who knew it. Claude Code was used at nearly every step: understanding the codebase, listing every order-related database field, mapping fields to the APIs that expose them, drafting technical designs, and implementing endpoint additions, logic changes, refactorings and DB migrations. An early broad question returned only about 30% of the fields, and a field-to-API mapping hallucinated matches until he added an "or None (if not exposed)" escape hatch to the prompt. For a related investigation of the old PHP monolith, Claude quietly swapped the requested Phan static-analysis pipeline for heuristics when it ran out of context, which led him to a Plan-Execute-Review approach (learn enough to implement it yourself, then say "implement it", then review like peer code). He also used Claude for CI code review, addressing PR review comments via the GitHub API, Mermaid diagrams, Jira tasks from design docs, and Kubernetes debugging, mostly in --dangerously-skip-permissions mode with explicit constraints and /clear between tasks. By the end Claude had written about 9,000 lines of production code across five services, all reviewed, tested and merged through the standard process, with one significant logical error (the wrong one of four ID fields) that neither he nor another reviewer caught.

The numbers (as reported)

Production code written by ClaudeAbout 9,000 lines across five services
Duration"What normally takes weeks took days" (no exact figure)
Significant logical errors found1 (wrong ID field, missed by two human reviewers)
First broad field-to-API query coverageAbout 30% of the fields

Facts

Company / subject
Mercari
Tools
Claude Code
Codebase
brownfield
Work type
Migration
Stack
PHP, Phan, Kubernetes
Published
2025-10-28
Last checked
2026-11-26

What the source claims Practitioner (own blog/paper)

Claimed by the builder, writing about their own work. Not checked independently.

  • What normally takes weeks took days
    “The result: what normally takes weeks took days.”
  • About 9,000 lines of production code across five services, reviewed, tested and merged through the standard process ~9,000 lines, 5 services
  • Only one significant logical error in all the generated code 1 significant error
    “Among all that code, there was only one significant logical error: it used the wrong field for an ID.”

Caveats

First-person post by the Mercari engineer who did the work. No exact durations, team size beyond starting solo, model, or cost are given; "weeks to days" is the author's characterisation. The PHP/Phan pipeline was a side investigation of the old monolith, not the migration itself, and the migration services' languages are not stated. engineering.mercari.com returned 503 on 25 and 26 Nov 2026; fields were read from the Internet Archive copy of 10 Jul 2026 (secondary_url).

More stories by tool: Claude Code

Related topics: MigrationsBrownfield codebases

Source

Mercari Engineering Blog (eg01ste)

Also: https://web.archive.org/web/20260710104056/https://engineering.mercari.com/en/blog/entry/20251028-the-ai-lied-to-me-and-thats-when-i-learned-how-to-use-it/

One email a week: what actually shipped

New sourced stories, the numbers behind them, and what didn't work. No hype.

We'll only use this to send the newsletter. See the privacy page.