The port that moved: how an auto-update broke a user's AI agent for three hours A developer's auto-update for Belay, a macOS utility that keeps Macs awake during AI coding sessions, broke a user's Claude Code agent for three hours by changing the loopback port the agent's hooks post to. The developer traced the issue to Belay's listener using an ephemeral port that changed on every launch, and found that NWListener ignores requiredLocalEndpoint, requiring the on: initializer instead. The fix was to bind to a fixed port and the developer shipped a corrected version. A friend sent me two screenshots. His terminal was full of this: Hook error: POST http://127.0.0.1:61716/hook?src=belay connect ECONNREFUSED 127.0.0.1:61716 Every tool call Claude Code made printed one of those. It had been doing it for about three hours. The app on the other end of that URL is mine. It's called Belay – a macOS menu bar utility that keeps the Mac awake while local AI coding agents are working. One of its detection tiers is a tiny loopback HTTP receiver: the agent's hooks POST lifecycle events "a tool call started", "the turn finished" to 127.0.0.1: