Working Surfacelink · 7 Nov 2026
03
A plumber seen from behind follows a vast tangle of pipes with a lantern and tightens one small joint, while beside him an exact miniature copy of the same pipework on a test stand already shows the drip has stopped, the whole scene drawn with wide empty margins on every side.
Sentry Blog

Finding backend performance wins with a coding agent

Scott Cooper · 3 November 2026

Company story · agents · critique & review · Work cut to size

Read the original
Takeaway

A Sentry engineer pointed an AI agent at Sentry's own performance data, tested each fix on a copy of the database, and removed hundreds of millions of weekly queries.

Summary

Scott Cooper, an engineer at Sentry, which sells software that tracks errors and slow code, spent several weeks using an AI agent to find slow backend code. He connected the AI agent to Sentry's own performance data through Sentry's MCP server, a connector that lets AI agents query a product. Most fixes changed a line or two of code.

Key points
  • The AI agent ranked database queries by how often they ran and how long they took, and gave a file, a line and an example for each.
  • Before changing anything, Cooper had the AI agent read the code and its change history and say what might break. He steered it away from areas he did not know.
  • The AI agent tested each query change on a read-only copy of the database, and every pull request linked to an example showing the extra work it removed.
  • One fix removed an estimated 143 million unnecessary database reads a week, and another cut a query from 935 milliseconds to 0.4 milliseconds on the copy.
Implication

Engineers who hand performance work to an AI agent can ask for evidence before review: a stated risk, a test on a copy of the data and a linked example. This is Sentry's account of work done with its own product.

Plays
Engineering

Have the AI agent read the code and its change history and state what might break before it changes anything.

Engineering

Have the AI agent test each database query change on a read-only copy of the database before it opens a pull request.

Derived by Working Surface from the article; more in the Playbook. Source line: Making sure the agent has the ability to validate changes in the read-only database rather than guessing leads to much better results.

Source issue

7 November 2026: teams using AI agents are judging work by evidence they can check, and are naming the people who decide what counts as good.