Oleksandr Kuzmenko, EditorPublished 7 min readAI-assisted · editor-reviewed
TL;DR
- Claude Code successfully retrieved and implemented acoustic localization research from a 2007 paper.
- Injecting dynamic modules over WebSockets prevents mobile browsers from resetting microphone permissions during agent-driven code iterations.
- Short acoustic chirps from low-latency devices allow microsecond-level synchronization of uncoordinated web audio streams.
Key facts
- Localization accuracy
- ~40 cm
- Audio buffer length
- 60 seconds
- Clip sync window
- 0.6s before beep to 0.8s after chirp
Source: Key facts — Audio buffer length
Source: Key facts. Audio buffer length: 60 seconds. Each figure is copied from the story.
- Audio buffer length60 seconds
Real-World Agentic Engineering Workflow
Simon Willison shared a compelling case study on vibe coding hardware-adjacent software using Claude Code. Facing an elusive beep from an old detector, he tasked Claude Code with creating Beep Locator, an acoustic triangulation system that runs on commodity mobile devices and laptops.
Claude retrieved the relevant academic research—the 2007 paper *BeepBeep: A High-Accuracy Acoustic-Based System for Ranging and Localization Using COTS Devices*—and synthesized the theoretical principles (sample counting, two-way sensing, and chirp alignment) into a functional Python and browser stack.
The WebSocket Hot-Swap Pattern
The most practical pattern for agentic web development is handling device state across rapid coding iterations. Mobile web browsers require explicit user confirmation to access the microphone every time a page reloads. Restarting client listeners after every Claude Code patch would stall the workflow.
To eliminate manual intervention, the agent implemented an installModule() remote evaluation interface:
1. Devices join a local Python server via WebSockets and initialize a 60-second WebAudio circular buffer. 2. When new features or detection algorithms are authored by Claude Code, the server broadcasts the executable JavaScript payload over the existing socket. 3. The client evaluates the module in-memory, swapping detection logic without triggering a document reload or dropping microphone permissions.
Acoustic Synchronization
To align recordings across clocks, the server commands the device with lowest round-trip latency to emit a brief audible chirp when a candidate beep is reported. All listeners send audio from 0.6 seconds before the beep to 0.8 seconds after the chirp, enabling cross-correlation and positioning accuracy down to 40 centimeters.
Try it in 2 minutes
// Hot-swap module over WebSocket to preserve browser audio permissions
socket.onmessage = (event) => {
const message = JSON.parse(event.data);
if (message.type === 'install_module') {
new Function(message.code)();
}
};When to use
- When rapid prototyping multi-device sensor applications with an agentic coding assistant.
- When testing client-side WebAudio processing across mixed mobile and desktop browsers.
When NOT to use
- In production environments where arbitrary remote code execution over WebSockets creates severe security vulnerabilities.
- For mission-critical acoustic detection requiring hardware-synchronized microsecond clocks.
What to do today
- Adopt dynamic WebSocket code evaluation patterns for mobile agent prototyping to avoid permission fatigue.
- Use Fast Fourier Transform filters directly within browser WebAudio buffers for edge event detection.
- Prompt Claude Code with problem definition markdown files before generating implementation code.
Step names are taken from What to do today.
Step names are taken from What to do today. Adopt dynamic WebSocket code evaluation patterns for mobile agent prototyping to avoid permission fatigue.. Use Fast Fourier Transform filters directly within browser WebAudio buffers for edge event detection.. Prompt Claude Code with problem definition markdown files before generating implementation code.
- Adopt dynamic WebSocket code evaluation patterns for mobile agent prototyping to avoid permission fatigue.
- Use Fast Fourier Transform filters directly within browser WebAudio buffers for edge event detection.
- Prompt Claude Code with problem definition markdown files before generating implementation code.
