Terence Tao Ported 27-Year-Old Java Applets With Claude Code in Hours — What It Teaches You About Agentic Coding
TL;DR: On July 11, 2026, mathematician Terence Tao used AI coding agents to port two dozen dead Java 1.0 applets to JavaScript in hours and finished a special-relativity tool he abandoned in 1999. The lesson isn’t “AI is magic” — it’s that long-context agentic sessions have a structural edge on bounded legacy migration, while inline completion does not. The agent found two real bugs Tao had missed.
| Agentic session (Claude Code / terminal agent) | Inline completion (Cursor Tab, Copilot) | Doing it by hand | |
|---|---|---|---|
| Best for | Bounded migrations with a clear success test | Active feature work in a file you know | Code whose intent lives only in your head |
| Legacy Java → JS port | Hours, whole-file rewrites | Poor — no whole-repo context | Days to weeks |
| Catches latent bugs | Yes (found 2 Tao missed) | Rarely | Only if you re-read every line |
| The catch | You must verify every diff | Can’t hold old + new API at once | Slow, but you keep full understanding |
Honest take: Reach for an agentic session when the task has a clear I/O contract and a pass/fail test — a legacy port is the textbook case. Keep inline completion for the code you’re actively thinking through. Tao’s result is impressive because he picked the right tool for a well-scoped job, not because the model is smart enough to trust blindly.
What Tao actually did
Terence Tao — Fields Medalist, one of the most cited mathematicians alive — spent a few days in July 2026 migrating his old web pages and blog data into a more maintainable repository, with AI assistance. As part of that cleanup he hit a familiar graveyard: a set of interactive math applets he had written in Java 1.0, starting in 1999, for his complex analysis and linear algebra courses. Browsers dropped support for that Java runtime years ago, so the applets had been dead for the better part of a decade.
He asked a coding agent to port them to a modern, supported language — JavaScript — and, in his account, it did so in a matter of hours. Roughly two dozen applets, all functional again, now live in his tao-web repository. The agents he reached for were terminal-based coding agents rather than inline suggestion engines, with Claude Code the one his write-up leaned on most.
Two details make this more than a nostalgia project.
First, the bug asymmetry. Reviewing the ported code, Tao could only spot one minor bug himself. The agent, going the other direction, flagged two bugs in his original 1999 code that he had never noticed — errors that had sat in the applets for 27 years. As he put it, the port ended up being a net improvement in code quality, not just a language swap.
Second, the resurrection of a dead idea. Back in 1999 Tao had wanted to build a special-relativity visualization tool — in his words, “Inkscape, but in Minkowski space,” a drawing environment where objects obey Lorentz transformations instead of Euclidean geometry. He abandoned it because the code complexity outran the time he could give it. In 2026, after a couple of hours of agentic “vibe coding,” he had a working applet that matched the original vision. A 27-year-old abandoned project, closed out in an afternoon.
That’s the story. The useful part for working developers is why it worked — and where the same approach falls on its face.
Why the terminal agent won, and Cursor Tab wouldn’t have
It’s tempting to read this as “the AI is good now.” The sharper read is about context architecture.
A legacy port has a specific shape. To rewrite a Java 1.0 applet as JavaScript, the tool has to hold three things in its head at once:
- The old code — the full applet, its quirks, its math.
- The old API’s semantics — what Java’s AWT
Graphicscalls actually did. - The target API — the HTML5 Canvas or SVG calls that replace them.
A terminal-based agent like Claude Code operates over whole files and multi-turn sessions. It can read the entire applet, reason about the mapping, write the replacement, run it, read the failure, and fix it — all inside one context window that stays coherent across the task. That loop is the whole game for migration.
Inline completion tools — Cursor Tab, GitHub Copilot’s ghost text — are built for a different job. They predict the next few tokens where your cursor sits, optimized for you actively writing code you already understand. They don’t hold the old API contract and the new one simultaneously, and they don’t drive a build-test-fix loop on their own. For a line-by-line port of two dozen files, they’d be the wrong instrument entirely. This is the same structural split we covered in our Cursor vs Claude Code comparison: agentic sessions and inline completion are not competitors so much as tools for opposite phases of work.
That structural advantage — not raw model IQ — is what carried Tao’s port. And it lines up with the broader adoption data: JetBrains’ AI Pulse survey (over 10,000 professional developers, January 2026) found Claude Code at 18% workplace adoption, a roughly 6× jump from ~3% in mid-2025 — the fastest climb any developer tool has posted in that window, tied with Cursor for second behind GitHub Copilot’s 29%. Terminal agents are winning exactly the tasks inline completion can’t touch.
Where coding agents have a structural edge on legacy code
Tao’s task wasn’t just legacy — it was tractable legacy. Three properties made it a good fit, and they’re the properties you should look for before you point an agent at your own dead code:
- Clear I/O contracts. A Java applet that draws a Mandelbrot set has an unambiguous output: the pixels it produces. The JavaScript port either draws the same picture or it doesn’t. When the boundary between “old thing” and “new thing” is a well-defined interface — one class becomes one module, one function’s inputs and outputs are fixed — the agent has a target it can hit and check.
- Well-documented API replacements. Java’s graphics primitives map onto Canvas/SVG primitives that are exhaustively documented. The agent isn’t inventing an approach; it’s translating between two well-known dialects. Migrations from a documented old API to a documented new one are the sweet spot.
- Deterministic, checkable assertions. A math visualization is pass/fail in a way most software isn’t. The rendered curve is right or wrong to the pixel. That gives the agent — and Tao — a cheap, objective verification signal on every iteration. When you can write a test that unambiguously says “done,” the agent’s loop converges. This is the same discipline we argued for in test-driven AI coding: the test is what makes the agent trustworthy, not the model.
Notice these are the same conditions that made our own real-world refactoring case study succeed. Bounded scope, a known target shape, and a way to check the result. When all three hold, an agent can close a task in hours that would’ve cost you a week.
Where they still fail
Now the honest half. Tao’s applets were a friendly case. The following are where the same agentic approach still breaks, and it’s worth being blunt because the headlines won’t be:
- Undocumented business logic. A 27-year-old drawing routine has math you can re-derive from the output. A 27-year-old billing system has rules that exist because of a lawsuit in 2011 and a spreadsheet nobody kept. The agent can port the code; it cannot recover the reasons. Where correctness depends on intent that was never written down, the agent will faithfully reproduce — or faithfully “clean up” — logic it doesn’t understand.
- Stateful side effects with no test coverage. Tao’s applets are essentially pure functions of their inputs. Real legacy systems mutate databases, hit external services, and depend on execution order. Without tests pinning that behavior, an agent’s refactor can pass every check you have and still be subtly wrong in production, because the checks never covered the side effect that mattered.
- Intent that lives in the author’s memory. The two bugs the agent caught were structural — inconsistencies visible in the code itself. It did not, and could not, catch a “bug” that’s actually a deliberate, undocumented workaround. Agents are strong at “this contradicts itself” and weak at “this looks wrong but is load-bearing.”
The pattern: agents excel where truth is in the code and checkable, and stumble where truth is in a human’s head. That maps cleanly onto Tao’s result — the wins were bounded and verifiable, the tool never had to guess at intent.
The trust calibration most coverage skips
Here’s the detail that separates Tao’s workflow from the cautionary tales: he verified. He reviewed the ported code closely enough to find one bug himself and to confirm the agent’s two findings were real. He didn’t rubber-stamp hours of machine-written diffs and ship them.
That’s the actual transferable skill. An agent that rewrites two dozen files in an afternoon is only a productivity win if you can review two dozen files’ worth of diffs faster than you could have written them — which, for a bounded port with a pixel-perfect test, you can. For an unbounded refactor of untested business logic, you can’t, and the speed is a trap. The right mental model, which we’ve argued before in when to trust an AI code suggestion: the agent proposes, a deterministic test disposes, and you audit the diff in between. Tao is a working mathematician who read the output. Do that.
Practical take: when to reach for agentic mode
Concrete decision rule for your own work:
Use an agentic session (Claude Code, or another terminal agent) when:
- The task is a bounded migration or translation — language port, framework upgrade, API swap.
- There’s a success signal you can automate — a test suite, a visual diff, a byte-for-byte output check.
- The contracts are clear — you can point at the “before” and describe the “after” in one sentence.
Stay with inline completion (Cursor Tab, Copilot) when:
- You’re actively designing and writing code you already hold in your head.
- The value is fast local autocomplete, not whole-repo reasoning.
Do it by hand — or write the tests first — when:
- The behavior is undocumented and untested, and getting it wrong is expensive.
- The correctness depends on intent nobody wrote down.
If you’re running long agentic sessions and the API bill starts to sting, a common cost-cutting move is routing the cheaper, mechanical passes to a local model — see runaihome.com’s guide to the best local models by VRAM for what your hardware can actually run as a fallback backend. For the deeper workflow patterns behind sessions like Tao’s, our Claude Code review and 10 AI pair-programming workflows go tool-specific.
The takeaway from a Fields Medalist resurrecting 27-year-old code isn’t that the tools are infallible. It’s that a smart operator matched a well-scoped job to the one tool shaped for it, and checked the work. That’s a workflow you can copy tomorrow.
FAQ
Which AI tool did Terence Tao use to port his applets? Terminal-based coding agents, with Claude Code the one his July 11, 2026 write-up leaned on most heavily. The key point is the category — an agentic tool that reads whole files and runs a build-test-fix loop — not the specific brand. Inline completion tools like Cursor Tab wouldn’t fit this task.
What did the AI agent find that Tao missed? Reviewing his original 1999 Java code, the agent flagged two bugs Tao had never noticed in 27 years. Tao himself only found one minor bug in the ported output. Net, the port improved code quality rather than just changing the language.
Can I trust an AI agent to migrate my legacy codebase? For bounded migrations with a clear success test — a language port, a documented API swap — yes, if you review the diffs and have an automated check. For undocumented, untested business logic where correctness depends on intent nobody wrote down, no. The test is what makes it safe, not the model.
Why is a terminal agent better than Cursor Tab for legacy code? A migration requires holding the old code, the old API’s behavior, and the new target API in context simultaneously, then iterating. Terminal agents do that across whole files and multi-turn sessions. Inline completion predicts the next few tokens at your cursor — a different job entirely.
Is “vibe coding” safe for production? Tao’s “couple hours of vibe coding” worked because the output was pixel-checkable and he verified it. Vibe coding is safe exactly when you can cheaply confirm the result is correct and you actually do. Without that check, it’s a way to ship bugs fast.
Sources
- Old and new apps, via modern coding agents — Terence Tao (What’s new), July 11, 2026
- AI Agents Ported Tao’s 27-Year-Old Math Code in Hours and Found Two Bugs He Had Missed — TechTimes, July 12, 2026
- Terence Tao — interactive tools (tao-web repository)
- Which AI Coding Tools Do Developers Actually Use at Work? — The JetBrains Blog (AI Pulse, April 2026)
Last verified: Jul 15 2026.
Was this article helpful?
Thanks for the feedback — it helps improve future articles.