Spotify lets agents change code at scale by investing in tests

Niklas Gustavsson describes the automation and verification behind Spotify’s coding agents and rapid prototypes.

NGNiklas GustavssonGuest · Chief Architect and VP of Engineering
Channel
Claude
Published
Jun 29, 2026
Video
26:11
Read
7 min
Original
English
Open on YouTube
Scroll to read and the video shrinks to the bottom-right corner. Captions follow your reading language.
Reading languageAvailable in 2 languages
You're reading the original English.
SUMMARY

In 30 seconds

Spotify’s Honk began as a way to automate maintenance across thousands of code components, and its existing test infrastructure now helps verify work by coding agents, says engineering leader Niklas Gustavsson. He reports that about 73% of pull requests are AI-authored and PR frequency has risen by more than 75%, while the company is still building ways to connect those outputs to user value. Better automation and consistent code, he says, are needed to keep quality steady as teams move faster. Spotify has also built an internal store where employees can share app prototypes.

  1. 1Spotify automated maintenance as its code grew faster than its teamGustavsson says the codebase was growing seven times faster than the number of engineers. Fleet-management infrastructure replaced repeated manual migrations across thousands of components.
  2. 2A model judge lifted early change success before later being removedGustavsson recalls success on pull requests rising from roughly 20–30% to 80% after adding a judge. He says improved models and agent infrastructure eventually made it unnecessary in Honk.
  3. 3Auto-merging changes required stronger testsTeams could no longer be in the loop for every automated change, so Spotify strengthened test automation. Those checks now help verify agent-generated work too.
  4. 4Speed and stable quality require continued reliability investmentGustavsson says Spotify has kept quality metrics neutral while moving much faster, but it had to invest in tests and expects further work on reliability.
  5. 5Spotify reports 73% of pull requests are AI-authoredGustavsson also attributes a greater than 75% rise in PR frequency to AI tools. Spotify is still building a way to link those outputs to experiments, user value and revenue.
  6. 6Consistent code gives agents better examples to followStandardization originally made engineers more productive; Gustavsson says it helps agents too because examples scattered across a repository are less confusing when they follow common conventions.
  7. 7Employees can share working app prototypes in an internal storeGustavsson says engineers and non-engineers can describe an idea and build a prototype using real app and backend infrastructure, sometimes in one or two hours.

Takeaways

  1. Invest in automated tests before relying on agents to change code that component owners may not manually review.
  2. Make code and frameworks more consistent so agents can learn from useful examples elsewhere in the repository.
  3. Gustavsson reports that around 73% of Spotify pull requests are AI-authored; the company is still working to connect engineering output to user value.
  4. Give employees a way to build and share prototypes quickly, including people outside engineering.
  5. Do not assume faster output preserves quality automatically; monitor quality and continue investing in reliability.
FULL TEXT

Read the edited text by chapter

Transcript only
01

From autocomplete to agents working in the background

Gustavsson describes the shift in his own workflow and the large repositories he works in. He says Claude can use existing code for examples.

Spotify engineering leader Niklas Gustavsson recalls being skeptical when Boris Cherny predicted that developers would stop using an IDE within months. Two months later, Gustavsson says, he had stopped using one himself; the way he worked changed more quickly than at any other point in his roughly 30-year career.

Gustavsson trained as a molecular biologist and learned more programming while working with genome-sequencing data during his doctorate. A planned year away from biology became a long career in software. Spotify later began experimenting with language models to automate code changes, initially with difficulty.

The early experiments did not solve every maintenance problem, but using models and judges gradually suggested a direction. For Gustavsson personally, a later Claude Opus release was a turning point: instead of treating the model as autocomplete and manually editing the last portion of its code, he could give it real problems without doing that final IDE pass himself.

Today Gustavsson describes a relatively simple setup with multiple terminal sessions and agents working in the background. He typically has five to ten tabs, matching terminals and worktrees. Spotify has a few large monorepositories alongside thousands of smaller repositories, so he opens temporary sessions when he needs the latter.

He initially worried about using agents on a very large monorepository because earlier tools struggled with indexing. Spotify’s backend monorepo contains more than 20 million lines of code, but he says Claude has worked well there, including by finding other code in the repository to use as inspiration.

Cherny asks how Spotify came to build Honk, its background-agent tool. Gustavsson says that five or six years earlier the company found its codebase growing about seven times faster than its engineering team, increasing the amount of code each engineer would eventually have to maintain.

02

Why Spotify built fleet-wide automation

The company’s code grew faster than its engineering team. Fleet management automated repetitive migrations, but deterministic scripts became difficult to extend.

Spotify wanted to keep shipping ideas rather than spend all its time on maintenance. Previously, migrations such as a Java upgrade or API change meant sending instructions to hundreds of teams, each of which made similar changes manually across thousands of components. A migration could take months, and the company could complete only around ten a year.

Fleet-management infrastructure automated many of those changes and merged millions of pull requests. But deterministic scripts hit a complexity ceiling: even changing an API became difficult when code could call it in many ways. Each script accumulated thousands of lines handling edge cases.

03

From one-shot edits to Honk

Spotify improved early model-generated changes through decomposition and a judge. Its current Honk agent runs with access to tools and verification builds.

Spotify tried early language models on the problem, but simply presenting code and asking for a one-shot edit did not work well. Models improved and the team learned to break the task apart and use a model as a judge of the result. Those iterations eventually became Honk, though its original version was not built on Claude.

Honk began by scheduling and orchestrating code changes across repositories. Engineers soon wanted to invoke it for other tasks, including from Slack, so it became a more general tool. Gustavsson says the released version called V2 is really the result of many more internal iterations.

Gustavsson says early versions of Honk benefited substantially from a separate judge: he recalls pull-request success rising from roughly 20–30% to 80%. The company later removed the judge because it found that the newer model and agent infrastructure were good enough without it.

The current architecture is relatively simple, he says: the Claude Agent SDK runs in a Kubernetes pod with access to tools. Earlier versions used a predefined allowlist; V2 lets users add their own tools. One important capability is running verification builds on Linux and macOS, the latter needed for iOS development.

Cherny asks whether verification can go beyond building to operating an iOS simulator. Gustavsson says it can: Spotify has integrated the simulator and Claude to help turn Figma designs into interface implementations and to port features from iOS apps to TV apps.

04

Verification lets automated changes reach owned components

Spotify strengthened tests as it began auto-merging fleet-wide changes. Gustavsson says quality and reliability still require active investment.

Cherny argues that verification is especially important when an agent decomposes a task and works without a person at each step. Gustavsson agrees and says Spotify strengthened test automation as part of its fleet-management work.

Spotify divides its codebase into thousands of components, each owned and operated by a particular team. Previously those teams could review every change to their own code, sometimes compensating for weaker tests. Automated pull requests changed that expectation: teams might never see a change before it was auto-merged, so tests had to improve.

Gustavsson says the earlier investment now helps Spotify verify agent-generated work too. Cherny argues that automating quality practices makes faster work possible. Gustavsson adds that speed and quality must both receive attention: Spotify’s quality metrics have remained neutral while speed increased, but the testing investment was necessary and reliability work must continue.

05

Deployments and measuring AI’s return

The company uses frequent deployment for faster feedback and reports higher pull-request frequency. It is building links from engineering work to user value.

Spotify makes roughly 4,500 production deployments a day, Gustavsson says, creating many opportunities for something to go wrong. Frequent deployment is a long-standing effort to get feedback on ideas quickly. Some ideas can reach production in about an hour, though others require extensive exploration and do not ship that fast.

The company has about 2,900 engineers. Asked how it measures return on AI tools, Gustavsson reports more than 75% improvement in pull-request frequency that Spotify attributes to AI, and says approximately 73% of pull requests are AI-authored. Those output measures are not the end of the measurement problem.

Spotify wants to connect pull requests and deployments to planned work items, then to experiments, rollouts, user value and revenue. Gustavsson says the company is still building those connections. As adoption matures, he expects more precise return-on-investment estimates to become important, including the cost of producing an improvement.

06

Standardization, changing work and faster prototypes

Gustavsson recommends consistent code and continued engineering fundamentals. Spotify is also enabling engineers and non-engineers to build and share prototypes.

For other engineering leaders, Gustavsson recommends not neglecting foundational investments such as test automation and standardization. Spotify made code, tools and frameworks more consistent to help people, and he says the same consistency helps agents find examples without encountering ten different ways of doing the same thing.

Gustavsson says he had worried that delegating coding might take away the mental challenge he enjoys, including in competitive programming. With several agents working in the background, he found that solving problems still mattered to him even if the way he solved them changed. He emphasizes that the transition will feel different for different people.

He says the tools let him contribute in unfamiliar codebases that previously would have taken days or weeks to understand. Cherny describes a similar shift away from implementation time toward thinking about what comes next, talking with customers and building prototypes.

Spotify has invested in prototyping for engineers and non-engineers. Gustavsson says employees can express an idea in natural language and have Claude implement an end-to-end prototype using the company’s mobile apps and backend. An internal app store lets colleagues share and try these prototypes.

Gustavsson says a working prototype can sometimes be ready to share in an hour or two, using real application infrastructure and data. He says people across the company, including a co-CEO and other senior executives, have built prototypes; an idea can be tried in a day instead of waiting weeks or months for an available team.

More from this channel

16:17EN
Claude· Nov 6, 2026How Salesforce doubled effective coding output with Claude CodeBoris Cherny, Muralidhar Krishnaprasad, Richard Pack · AnthropicSalesforce describes how it measures AI-assisted work, trains engineers to use agents, and checks the resulting code for defects.AI engineering leadershipAgent skillsCode review & verification+2
10:38EN
Claude· Oct 23, 2026Factory’s Matan Grinberg on building software agents people can trustKai Gill, Matan Grinberg · AnthropicFactory’s CEO says an agent learned from one bank’s COBOL migration, reducing human involvement in the next by 90%.Coding agentsSoftware factoriesEnterprise AI+2
Slides12:19EN
Claude· Oct 8, 2026Shopify’s Mikhail Parakhin: Spend on AI to do what was once impossibleBoris Cherny, Mikhail Parakhin · AnthropicShopify’s CTO describes a merchant prediction system and argues for using the largest models in development, then cheaper ones in production.AI StrategyAI cost & performanceDeveloper productivity+2
33:46EN
Claude· Oct 6, 2026How Every builds a shared AI coworker that learns a team’s styleKatelyn Lesse, Dan Shipper, Willie Williams · AnthropicEvery’s Slack agent shares workflows, learns from an editor’s past changes and uses isolated sessions to respect access boundaries.AI agentsAgent memoryAgent skills+2
Slides17:50EN
Claude· Sep 24, 2026Patrick Collison on shipping faster with AI without losing reliabilityBoris Cherny, Patrick Collison · AnthropicStripe’s CEO describes isolated development, hard security boundaries and an AI-assisted project built by two to three engineers in two months.Coding agentsDeveloper workflows & testingObservability & reliability+2
34:42EN
Claude· Sep 8, 2026Three founders on verifying, scaling and paying for AI agentsLance Martin, Sahaj Garg, Mihir Garimella, Todd Olson · AnthropicWispr, Actively and Pendo explain how they build agent products, test their work and decide what infrastructure to manage themselves.Agent engineeringAgent memoryEvals & observability+2