Spotify's Background Coding Agent (Honk Part 2): Context Engineering with Claude Code
Spotify's background coding agent needed reliable context engineering to produce mergeable pull requests at scale across thousands of repositories, but early agent approaches struggled with complex multi-file changes, context window limitations, and the difficulty of writing prompts that generalise across repos.
How it works
Common implementation structure
How this type of workflow is generally built, generalized across documented cases — not tied to any one vendor's stack. Click any stage to read what happens there. Specific products that implement these stages appear in “Tools commonly seen” below.
Stage 1 · User submits prompt and file scope
The user provides a prompt and a list of all files in scope to initiate the coding agent task.
Tools used
Claude CodeClaude Agent SDKGooseAiderModel Context Protocolripgrep
Outcome
Claude Code became Spotify's top-performing background coding agent, applied across about 50 migrations with the majority of background agent PRs merged into production, and at scale merging thousands of PRs across hundreds of repositories.
What failed first
Open source agents Goose and Aider could not reliably produce mergeable PRs at scale, and Spotify's homegrown agentic loop required overly rigid step-by-step instructions and struggled with complex multi-file changes and context window exhaustion.