Speaker Notes

How Spotify runs agents across 20M+ lines of code, with Niklas Gustavsson

Spotify leverages parallel Claude agents and its internal Honk infrastructure to automate large-scale code migrations, boosting PR frequency by over 75 percent and empowering non-engineers to prototype via natural language.

Claude · 26:11 · YouTube ↗

Interview · 1 host and 1 guest  Advanced · concepts and internal architecture

Highlights

5 clips · 7 min of 26 min
    • Claude handles codebases exceeding 20 million lines of code seamlessly.
    • The model successfully draws inspiration from existing code patterns across large monorepos.
    • Traditional static analysis scripts hit complexity ceilings due to vast API surfaces.
    • Early LLM attempts failed at one-shot code modifications without task decomposition and judges.
    • Honk runs inside Kubernetes pods using user-defined tools and built-in verification.
    • Support for Mac OS builds and simulator integration enables automated iOS and TV app porting.
    • Spotify directly attributes a 75 percent plus improvement in PR frequency to AI tooling.
    • Roughly 73 percent of PRs are now directly identified as being AI-authored.
    • Non-engineers and engineers alike use natural language and Claude to build end-to-end prototypes.
    • Working prototypes are shared via an internal app store, validating ideas in hours instead of months.

Questions this video answers

10 · every answer cites the moment it was said
01 How do I run Claude Code effectively for daily development tasks? 2 sources · 3:22

Niklas runs Claude Code in multiple TMX terminal sessions with 5 to 10 tabs open concurrently. He sets up a matrix of sessions matching terminals across different work trees to handle both large monorepos and temporary poly repos.

02 How well do AI coding agents perform in massive monorepos? 2 sources · 4:38

Claude works surprisingly well in massive repositories containing over 20 million lines of code. It excels by looking at existing code in the repository to gather inspiration for solving the current problem.

03 Why did Spotify move away from deterministic scripts to agents for code migrations? 2 sources · 7:16

Traditional static analysis scripts required thousands of lines of code to handle edge cases and variable state tracking, hitting a complexity ceiling. Shifting to LLM agents allowed them to handle complex code mutations without writing endless custom parsing scripts.

04 What is the architecture of Spotify's internal Honk agent system? 2 sources · 10:37

Honk runs the agent SDK inside a Kubernetes pod with access to a set of internal tools. Users can add custom tools, including the ability to run Linux and macOS CI build verification directly.

05 Do agentic workflows require an LLM-based judge for output verification? 2 sources · 10:00

Spotify initially relied on an LLM judge to boost PR success rates from 20-30% to 80%. However, as base models and agent harnesses improved, they eliminated the separate judge component entirely.

06 How do you safely automate PR merging without human code reviews? 2 sources · 12:38

Automated merging requires strong test automation tied to well-defined component ownership where individual teams take full responsibility. This ensures the codebase can survive automated changes merged without human review.

07 How does increasing deployment speed impact system reliability and quality metrics? 2 sources · 14:31

Spotify maintains neutral quality metrics while significantly improving development speed by investing heavily in test automation and reliability practices. With thousands of daily production deployments, robust automated verification is essential.

08 How does Spotify measure the ROI of AI-driven developer tooling? 2 sources · 17:00

Spotify measures ROI by tracking a 75% plus improvement in PR frequency directly attributed to AI tooling, where around 73% of PRs are AI-authored. They are also working to connect these deliverables to planned work items, AB tests, and user value.

09 What foundational engineering practices are most critical when adopting AI agents? 2 sources · 19:48

Standardization and consistent codebases are vital because agents rely on existing patterns for inspiration. If codebases look fragmented, agents become confused, making sane engineering practices and code alignment more important than ever.

10 How are non-engineers at Spotify leveraging AI to build and test prototypes? 2 sources · 23:43

Spotify built infrastructure allowing non-engineers to express ideas in natural language, which Claude then implements in real mobile and backend apps. These end-to-end prototypes are shared via an internal app store, allowing teams to validate ideas in hours instead of months.

Section-by-section summary

5 parts

Claude works surprisingly well in large monorepos

Niklas runs multiple terminal sessions and agents in parallel to handle routine tasks. Claude excels at navigating massive codebases like Spotify's 20-million-line backend monorepo by drawing context directly from existing code.

Scaling maintenance automation into internal agent systems

Spotify's codebase grew much faster than engineering headcount, requiring automated mass migrations. After hitting limits with traditional static analysis scripts, they evolved these systems into Honk, an agentic infrastructure built on top of the Claude agent SDK.

Automated verification enables hands-off agentic workflows

Successful closed-loop agent development requires robust test automation and verification systems. Spotify runs comprehensive CI builds on both Linux and macOS, allowing agents to safely merge changes without human intervention.

Tracking massive gains in PR frequency and quality

Spotify measures ROI by tying engineering deliverables like PR frequency directly to AI tooling, seeing over a 75 percent improvement. While quality metrics remain neutral, maintaining this velocity requires continuous investment in test reliability and codebase consistency.

Natural language prototyping unlocks ideas across the company

With implementation time shrinking, engineers and non-engineers alike now use agents to rapidly build end-to-end prototypes. An internal app store lets anyone share these working prototypes, drastically cutting down the time required to validate new product ideas.

0:00 / 26:11
k play/pause · f fullscreen · m mute
n next · p previous clip · t highlights/full
< > slower/faster · / search what was said
  • Honk4× · first 5:05

    Spotify's internal background agent infrastructure used for orchestration, maintenance, and task execution.

  • Claude Code10× · first 2:10

    A terminal-based AI coding assistant used in multiple terminal sessions and work trees.

  • Fleet management2× · first 6:14

    Spotify's infrastructure built to automate large-scale code mutations and migrations across thousands of repositories.

  • Agent SDK3× · first 5:15

    The foundational software development kit used to build background agents inside Kubernetes pods.

  • Monorepo3× · first 3:54

    A very large single source code repository containing millions of lines of code.