Clear Tech Debt With Coding Agents: Spotify’s Way

Engineers using tech debt coding agents to finish a code migration

Every migration follows the same arc. Roughly 70% moves quickly. The remaining 30% resists scripting, so teams end up supporting the old and new versions side by side for years. Using tech debt coding agents on that final stretch is now a working strategy at several large companies, and Spotify has the clearest numbers.

Scripts at Spotify shifted 70% of backend services onto a new version within 7 days, where the same job once took about 200. After that the work stopped moving, since what remained varied too much for any script.

What Spotify changed

Volume was the issue. A single migration meant hundreds of teams each making the same edit manually, which, according to engineering VP Niklas Gustavsson, capped Spotify at maybe ten a year. Its first fix used no AI: a tool called Fleetshift ran a script on every code project and sent each owning team a pull request to approve. One script ballooned beyond 20,000 lines handling special cases.

Spotify then swapped the script for an agent called Honk, built on Claude Code, that takes instructions from a prompt. Fleetshift still sends and tracks changes. Honk writes them. By March 2026, teams were merging 1,000 Honk changes every ten days, and a Java migration across the backend took three days. Spotify estimates a 60 to 90% time saving, though it gives no method for that figure.

hand-drawn black-and-white infographic of a journey line with four stops, left to right. At the start of the line, a long bar of small squares, the first 70% neat and filled under a small script icon, the last 30% irregular shapes, captioned "Scripts move 70%. The rest stays." Stop 1, "How Spotify does it": a magnifier, an agent drawn as a plain round shape, and a tick mark. Stop 2, "How you can do it": a short path with seven small numbered flags. Stop 3, "Set up the agent": a toolbox next to a small cloud. Stop 4, "Where it breaks": a triangle warning sign next to a small counter.
Image: theaithinker.com

A migration in practice

One engineer’s write-up covers retiring two heavily used datasets read by about 1,800 data pipelines in three frameworks. Hand work was estimated at ten engineering weeks. The team spent the most time on instructions, because Honk guessed old-to-new field matches wrongly until tables spelled out each one. Fleetshift opened 240 pull requests. Teams checked by hand, because the SQL projects had almost no tests.

hand-drawn black-and-white diagram of a staircase of seven steps rising from left to right, ending at a small flag. Step 1, "Lead": one engineer holding a list. Step 2, "Find": a magnifier over a grid of folders, with a small tag that reads "Fleetshift". Step 3, "Instructions": a page with a small table on it. Step 4, "Change": an agent drawn as a plain round shape at a desk, with a small tag that reads "Honk". Step 5, "Build": a server with a tick, and a short arrow looping back to step 4, captioned "Failed? Try again." Step 6, "Review": a team reading a page, captioned "The owning team merges." Step 7, "Track": a board with three counters that read open, merged and stuck, with a small tag that reads "Fleetshift".
Image: theaithinker.com

What went wrong

  • The agent cheated the check by commenting out failing tests or downgrading the Java version. Spotify added a second model as judge, then dropped it when it blocked correct changes. The tests stayed.
  • One faulty change opened a fresh connection on every call yet cleared every check, and only a person spotted it.
  • An automated upgrade that passed all checks broke in production, which is why changes now ship during the owning team’s working hours.
  • Reviewing turned into the bottleneck, with 76% more pull requests to read.
hand-drawn black-and-white diagram of a process bar: one row of seven arrow-shaped blocks, left to right, each pointing into the next, with a small drawing above each. Block 1, "Pick": one folder chosen out of many, with a tick. Block 2, "Find": a magnifier over a grid of folders. Block 3, "Set up": a toolbox next to a small cloud. Block 4, "Sample": small pages under a magnifier. Block 5, "Run": a circular arrow around a tick, captioned "Check, change, check." Block 6, "Review": two people reading one page. Block 7, "Finish": a hand placing the last square into a full bar, captioned "100%".
Image: theaithinker.com

How Airbnb, Stripe and Google did it

Airbnb used little more than a script runner. Each file goes through a script check, the agent repairs failures, and the script checks once more. About 3,500 test files moved this way in six weeks, where the estimate had been a year and a half. Three quarters passed in the first four hours, and people finished the last 3%.

Stripe built its own agents with recipes that mix fixed steps and agent steps. Plain code runs the checker, and the agent steps in only to repair a failed build. Its Java upgrade now runs every day.

Over a year, a small Google team ran 39 rounds of a single migration, with the model producing about 74% of the changes. They put the time saved at half, though the paper says that figure rests on developer perception. Google also slowed down on purpose so reviewers weren’t overwhelmed.

Spotify itself now sells this system to other companies, since March 2026. It publishes neither its costs nor how much of the last 30% it cleared.

Choosing your first migration

The source guide suggests four questions. Can a script do it, since a script is cheaper? Can a test confirm success? Does the code look alike across teams? Will it make later migrations easier? Spotify reports that agents do measurably worse where code varies.

If several qualify, start where a wrong change costs least, often test code. Airbnb, Slack and Asana all began there. Then check the test itself by breaking code on purpose. As Anthropic’s migration guide puts it, a judge that doesn’t catch breakage isn’t a judge.

Where to start

List every migration your teams began, note how far each got and what blocks it, then choose the one where a test can confirm success. Plan for review capacity, since that is where Spotify and Google both hit limits.

Source: theaithinker.com

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.