◉CLAUDE LABJP
●CC 2.1.332 — 2.1.332 (11/25) is still current. Skills from MCP servers appear as server:skill (beta)●OPUS 4.5 — Opus 4.5 is now scheduled to retire from the Claude API on 2027/1/22. Move to claude-opus-5-5●SONNET 4.5 — Sonnet 4.5 retires from the Claude API tomorrow, 11/30. Last day to check for hard-coded IDs●DISK — Users on Windows report Cowork's session disk filling up with no way to clean it●NEW — New: Asking Cowork for a meeting draft? Hand over old minutes after the outline is set●JETBRAINS — Our guide to using Claude with JetBrains IDEs is still among the most-read pages●CC 2.1.332 — 2.1.332 (11/25) is still current. Skills from MCP servers appear as server:skill (beta)●OPUS 4.5 — Opus 4.5 is now scheduled to retire from the Claude API on 2027/1/22. Move to claude-opus-5-5●SONNET 4.5 — Sonnet 4.5 retires from the Claude API tomorrow, 11/30. Last day to check for hard-coded IDs●DISK — Users on Windows report Cowork's session disk filling up with no way to clean it●NEW — New: Asking Cowork for a meeting draft? Hand over old minutes after the outline is set●JETBRAINS — Our guide to using Claude with JetBrains IDEs is still among the most-read pages
Articles/Claude.ai
◉ Claude.ai/2026-07-11Advanced

When a Connector Starts Slowing Down at Night: A Health-Aware Circuit Breaker for Solo Automation

Seeing connector errors and latency is only half the job — the other half is deciding when to route around them. This is my implementation of a circuit breaker that opens on error rate and p95, with runnable Python and notes on wiring it into nightly jobs.

MCP63connectors4circuit-breaker4automation110indie-dev14

✦ Premium Article

The week after I added instrumentation, the same connector started slowing down again.

Last time it had failed silently for two nights before I noticed. This time it wasn't erroring at all — the latency just crept upward. The p95 climbed from its usual 900ms to somewhere near 12,000ms. The nightly job wasn't crashing, but every single item was clinging to the edge of a timeout. The logs made the trouble obvious. But that night, I was asleep.

Seeing a number and acting on a number turned out to be two different things. Observability gave me a dashboard, yet without someone at the wheel when the needle swings into the red, the run just keeps stacking up the same failure until dawn. This time I wanted the "turning the wheel" part to run on its own, with no one watching.

The instrumentation itself I wrote up earlier, in bringing nightly connector observability into a solo setup. This piece is the sequel: turning those collected signals into a decision about whether to route around the connector.

Plain retries backfire on a slow night

The first thing I reached for was a naive retry. On failure, wait a moment and call again. That works when the failure mode is a hard error. But when a connector fails the way this one did — slow instead of down — retrying made things worse.

If a call clings on for 12 seconds and then fails, and you retry three times, you've burned 48 seconds on that one item. When you're running dozens of items in sequence overnight, everything downstream gets pushed out, and the whole night's batch quietly comes up empty. The harder you push against a slow connector, the more you drag perfectly healthy downstream work down with it.

What I needed wasn't a "keep trying" decision but a "stay away for now" decision. While the connector is unwell, hold back the calls, divert the work to a fallback, and ease back in to check once there's a sign of recovery. That is exactly the old idea of a circuit breaker. I decided to slip one of these breakers into my solo nightly jobs.

Three signals for measuring health

Whether to open the breaker is decided from three numbers taken over a recent observation window (I use 15 minutes).

SignalMeaningMy starting threshold
Error rateFailures / total calls within the windowOpen above 0.5
p95 latencyThe practical ceiling, dropping the slowest 5%Open above 8,000ms
Minimum samplesHold off deciding below this count8 calls

Watching p95 rather than the mean was the crucial part. When most responses are fast, the mean dilutes the slow ones and hides the state where only a fraction are near timeout. On the night above, the mean sat comfortably around 3 seconds while the p95 had reached 12. The p95 is the more honest way to capture a heavy tail.

The minimum-sample floor exists so I don't jump to conclusions on the first few calls. Nightly jobs tend to be shaky right after they start, and if the first two happen to be slow, tripping the breaker there would shut out a perfectly healthy connector.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦If a slowing connector has been quietly wasting your nightly runs until morning, you'll be able to decide automatically — from error rate and p95 — whether to route around it right now
✦You'll get the Closed / Open / Half-Open three-state machine and its rolling window as Python you can copy and run as-is
✦You'll learn how to carry connector health across process boundaries in scheduled jobs, and to confirm recovery without trusting a single lucky success
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◉ Claude.ai2026-10-19
Claude Said the File Was Created, but the Folder Was Empty — A Read-Back Check After Every Write
When a file-creation call reports success but nothing exists on disk, here is the order I use to narrow down the cause, plus a small script that reads back every write.
◉ Claude.ai2026-05-04
Claude Desktop in 2026 — How It Differs from the Web App, Connecting MCP in Your First 30 Minutes, and What to Check When Tools Don't Appear
You installed Claude Desktop, but it looks just like the web app. Here is what actually differs, how to connect a local MCP server through Desktop Extensions or the config file, a troubleshooting table for tools that never show up, which reference servers have been archived, and where Projects and Artifacts fit — checked against official sources as of November 2026.
⟐ Claude Code2026-07-27
Whose Environment Expands That Variable? Fingerprinting Your Effective Managed MCP Policy
Variable references in the Managed MCP allowlist and denylist now resolve from the startup environment and the managed-settings env block. I rebuilt both resolution orders locally to see where verdicts diverge, then wrote a preflight check that reduces the effective policy to a comparable fingerprint.