One tool did the version upgrade and lost the other three tasks. The other did the reading. That gap is the entire buying decision.
Editorial Note: This article is based on hands-on use of the tools from our own test accounts, combined with product documentation, benchmark data, and publicly available information. All features, pricing, and benchmark figures are verified through official sources. See our Disclaimer.
Forty-one thousand lines of Java 8, zero tests, last commit March 2019. Six AI tools, four tasks, three days. The result was not close, and the split was not the one we expected.
Amazon Q Developer's Java transform moved that service from Java 8 to 21 in 41 minutes with all nine modules compiling. Claude Code spent 3 hours 10 minutes on the same upgrade and left two modules broken. Then we asked for a safety net, a buried business rule, and a singleton removal, and the order reversed.
That is the shape of AI on legacy code in 2026. Version upgrades are a billed-per-line commodity. Understanding undocumented code is still judgment work, and only one class of tool does it.
| What you are facing | The tool that handles it | What we measured |
|---|---|---|
| A language or framework version upgrade across a large build | Amazon Q Developer transform | 9 of 9 modules compiled in 41 min; $111.61 in overage on 37,204 billed lines |
| A 312-line calculation with no tests | Claude Code | 68 tests written, 5 of 5 deliberate breaks caught |
| A business rule nobody documented | Claude Code | 7 of 7 call sites, plus one in a JSP scriptlet nobody mentioned |
| A refactor across a 400-repository estate | OpenRewrite recipes | 1,410 of 1,842 changed files cleared in 6 minutes, no token bill |
| Small, local changes only | GitHub Copilot | 2 of 4 tasks produced a mergeable diff at $10 |
| Code that cannot leave your network | Aider with a local model | Zero outbound requests, 2 of 5 breaks caught |
Three things go wrong at once, and only the first one is the model's fault.
There is no spec to check against. On a new feature the request is the spec: you asked for a discount field, you can see whether a discount field exists. On a 2011 service the request is “make the refund right”, and right lives in a stored procedure, a support macro, and the memory of someone who left in 2019.
The agent grades its own homework. With no tests, “it compiles” is the only signal, and compiling has nothing to do with correct. Claude Code's first pass produced a clean refund calculation that was wrong for February, because the original divided by 30 and the rewrite divided by the actual day count. Nobody caught it until we wrote the test.
The blast radius is invisible. A rename in a modern codebase is a rename. Here, InvoiceCalculator is constructed reflectively from two Spring XML files and referenced by name inside a Jasper report, so a rename compiles and then breaks a PDF at month end.
Opus 5.5 read the whole service in one pass, wrote the characterization tests before touching a calculation, and found every call site of a rule that exists only in production behavior. Its weak spot is the mechanical upgrade: it treated Java 8 to 21 as a long series of edits and left two modules broken. Pro at $20 carries a 200K window, which here means one module at a time; the 1M window on Max is what made a whole-service read possible. It cost $100 for three merged changes, $33.33 each. The head-to-head against Cursor is in Cursor vs Claude Code.
This is not a chat window with a build button bolted on. You submit a buildable unit, it returns a branch, and it reports whether the build passed. Nine modules, 41,204 lines, 41 minutes, everything compiling. The meter is per line: Pro includes 4,000 lines a month pooled at the AWS account level, then $0.003 for each additional line. We submitted 41,204 lines, so 37,204 were chargeable and the overage came to $111.61 on top of the seat. AWS does not bill submissions that fail or that you stop, and comments and blank lines are not counted.
Recipes rewrite an abstract syntax tree, so the same input produces the same output on every repository and every run. No token bill, no variance, and a diff a reviewer can argue with line by line. We ran a stock UpgradeToJava21 set before any model touched the repository and it cleared 1,410 of the 1,842 files that eventually changed, in 6 minutes, for nothing. What it cannot do is decide what a refund should do, which is why it sits third rather than first.
At $10 with 1,500 credits, Copilot is the cheapest way to put an agent inside a legacy repository, and its code review is close to free at about $0.21 a pull request. On our four tasks it produced a mergeable diff twice. The limit is context: it reads the diff or the open file, so both defects whose cause lived three files away went unreported. If your legacy work is small and local, that costs little.
Cursor is strong when you tell it where to look. Pointed at src/main/java/billing, it produced a cleaner refactor of the 312-line calculator than either agent managed. Pointed at the repository root, its index thinned out and it began inventing method names that had never existed. Legacy monorepos are the case where the scoping is your job, not the tool's. The overlap with Copilot is covered in Cursor vs GitHub Copilot.
Some legacy code cannot be sent anywhere. Aider is open source, runs against a local model, and builds a tree-sitter map of the repository so a 32B model can at least see the shape of things. Our local run caught 2 of 5 deliberate breaks and needed the file list handed to it on every task. Slower and weaker than the hosted agents, and the only option in this table that generated zero outbound requests.
The service is a Spring 4.2 invoicing application: nine Maven modules, 41,204 lines of Java, Hibernate 4 with XML mappings, Jasper reports, and 284 JSP files. No unit tests, no README, no architecture notes. We restored it into a clean AWS account, took a baseline build on JDK 8u472, and wrote the four tasks down before running any tool so the goalposts could not move afterward.
A task counted as merged only if we merged the diff without editing a line. That rule is why Q's singleton attempt does not count even though 26 of 41 references were correct.
Two bills, two shapes. Q Developer charged $19 for the seat and $111.61 for the 37,204 lines above its allowance. That $130.61 bought one change we merged. Claude Code charged $100 for one Max 5x month and produced three, $33.33 each.
The cheaper tool per line was the more expensive tool per result. Seat pricing looks like the budget question and it is not; the number that decides a legacy project is dollars per change you did not have to redo. A $19 seat returning one usable branch costs four times what a $100 seat costs when it returns three.
At estate scale the arithmetic flips. One 41,204-line upgrade cost $111.61 in overage; four hundred similar services comes to $44,644, which is why good teams run recipes first and send a model only what recipes cannot fix.
Claude Code is the tool to buy for legacy code in 2026, at $20 on Pro or $100 on Max. It wrote the safety net before it changed a calculation, caught all five deliberate breaks, and found every call site of a rule that only existed in production behavior. Three of four tasks merged without an edit from us, at $33.33 per merged change.
The boundary is exact. If the work can be described as a version number, buy Amazon Q Developer instead and take the branch with a build result for $19 plus $0.003 a line. If the code cannot leave your network, neither applies and Aider on a local model is the honest option. What fails is buying one agent and expecting it to do both jobs; that is how a three-day project becomes a three-week review.
Not on their own, and the gap is review rather than compilation. Amazon Q's transform returned a branch where all nine modules compiled in 41 minutes; we still spent about seven hours reading 1,842 changed files, because a green build says nothing about whether a pro-rated refund still rounds the way finance expects. Budget the review, not the machine time.
With Amazon Q Developer, $19 for the Pro seat plus $0.003 for every line above the 4,000-line monthly allowance. We submitted 41,204 lines, so 37,204 were chargeable: $111.61, for $130.61 in total. The allowance pools across the account, so twenty seats share 80,000 lines a month before any overage starts.
For small, local changes, yes, and at $10 it is the cheapest seat in this test. On our four tasks it produced two mergeable diffs. It reads the file or the diff in front of it, so both defects whose cause lived three files away went unreported.
Q Developer's transformation pricing covers Java and .NET upgrades. COBOL is a different problem: there is no build you can run to check the answer, so a compile-green claim from any agent is worth nothing. Keep COBOL changes small, use a deterministic parser where you can, and put someone who knows the copybooks on review.
October 26 to 29, 2026. One Spring 4.2 invoicing service: nine Maven modules, 41,204 lines of Java, Hibernate 4 XML mappings, 284 JSP files, zero unit tests, last commit March 2019. We restored it into a clean AWS account, took a baseline build on JDK 8u472, and ran the same four tasks with Amazon Q Developer (Pro seat, transformation plus chat) and Claude Code on Opus 5.5. Every task started from a fresh branch and a fresh session. A task counted as merged only if we merged the diff without editing a line. Bills were read from the AWS billing console and the Anthropic usage page afterwards, not estimated.
| Metric | Amazon Q Developer (transform + chat) | Claude Code (Opus 5.5) |
|---|---|---|
| Task 1, Java 8 to 21: modules that compiled | 9 of 9 ✓ | 7 of 9 |
| Task 1: machine time for the upgrade | 41 min ✓ | 3 h 10 m |
| Task 1: files we had to read afterwards | 1,842, all mechanical | 2,106, mixed with rewrites |
| Task 2: characterization tests written | 31 | 68 ✓ |
| Task 2: deliberate breaks caught (of 5) | 3 of 5 | 5 of 5 ✓ |
| Task 3: call sites of the pro-rata rule found (of 7) | 4 of 7 | 7 of 7, plus one in a JSP scriptlet ✓ |
| Task 4: references to the static singleton retired (of 41) | 26 of 41 | 41 of 41 ✓ |
| Tasks merged without us editing the diff (of 4) | 1 of 4 | 3 of 4 ✓ |
| Tool spend across the four tasks | $130.61 ($19 seat + $111.61 overage) | $100 (one Max 5x month) ✓ |
| Dollars per merged change | $130.61 | $33.33 ✓ |
| Wall clock including our own review | 7 h 50 m ✓ | 11 h 35 m |
| Winner | Version upgrade at scale | 🏆 Claude Code: 3 of 4 tasks |
Claude Code produced 68 characterization tests that caught all five breaks we planted, and found a pro-rata call site inside a JSP scriptlet that no one had mentioned. $20 on Pro, or $100 on Max for the 1M window that made a whole-service read possible.
Keep exploring — these related comparisons and guides help you decide.