Locating the source of a mysterious beep with Claude
Source
simonwillison.net
Date
Why it matters
Shows a real Claude Code build where the first approach (devices playing sounds to locate each other) underperformed and a manual rough-placement mode fixed it, a useful pattern for iterating on AI agentAn AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.Full definition →-built prototypes.
Key takeaways · AI-distilled
Simon Willison had Claude Code build Beep Locator, which turns several phones, tablets and laptops into browser microphones to triangulate an intermittent beep. It placed the source within about 40cm: an old carbon monoxide detector needing new batteries.
Having the devices locate each other by playing sounds, an idea drawn from the 2007 BeepBeep acoustic ranging paper, did not work well in practice. A "Rough mode" where he dragged device icons to approximate spots, then let sound refine them, fixed it.
Each listener keeps a 60-second audio buffer and flags beeps with an FFT and a high-pass filter. When one is reported, the device with the lowest round-trip time plays a chirp so every listener's uploaded clip can be time-aligned.
An installModule() agent hookA script the harness runs automatically at a fixed point in an agent's loop — before a tool call, after an edit, on session start.Full definition → let the server push new JavaScript to listeners over WebSockets. That avoided repeated microphone permission prompts on reload and let Claude Code reconfigure its "ears" and keep experimenting while Willison was away.
Willison began the build with Opus 5.5 on Claude Code Cloud from his iPhone, then moved to Fable 5.2 on his laptop for live iteration, adding clap-based testing, timestamps and per-listener clip replay through short prompts.
Terms in this piece · Glossary
AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
agent hook — A script the harness runs automatically at a fixed point in an agent's loop — before a tool call, after an edit, on session start.