Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By fuadnafiz98v0.6.0MITIn 1 marketplace
Resumes a Claude Code turn that was killed by a transient API error, so unattended runs survive the night instead of waiting for someone to type "continue".
You run one by typing its /name in Claude Code.
Executables (bin/) — files in this plugin's bin/ directory are added to the Bash tool's PATH while the plugin is enabled.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A watchdog timer for Claude Code. When the API drops a turn, it resumes it, so an unattended run keeps going instead of sitting at
⏺ API Error: The response stopped arriving. The response above may be incomplete.
until you come back and type continue.
Nothing to install beyond the plugin. macOS and Linux. The part that stays resident costs ~1–2 MB and zero CPU, and tmux is optional.
claude plugin marketplace add fuadnafiz98/plugins
claude plugin install watchdog@fuadnafiz98
or the same two steps as /plugin marketplace add … and /plugin install … inside a
session. Note the nesting: it is claude plugin marketplace, not claude marketplace,
which is not a subcommand and is silently treated as a prompt.
Restart the session (monitors start at session start), then arm it:
/watchdog on
It does nothing until you arm it. Off by default, because auto-continuing is what you
want overnight, not while you're watching. /watchdog reports whether it is armed and
whether the in-band channel is live:
armed: NO -- nothing will be resumed
arm it with: /watchdog on (or: watchdog on)
If a turn dies while it is installed but not armed, it says so on the spot rather than staying quiet:
watchdog: installed but not armed, so this turn was not resumed.
Run /watchdog on (or `watchdog on`) to arm it.
Claude Code retries a transient API failure itself first — in a live test against an
endpoint returning 529 it made ten attempts over about three minutes before giving up. The
watchdog only sees what survives that, and only then starts its own backoff. So after an
error you should expect minutes of Claude Code's own retrying, then the resume. It is not
idle; watchdog log shows exactly when it took over.
A different failure, and the one that actually costs you time:
✻ Waiting for API response · will retry in 2m 0s · check your network
The request was accepted and then nothing came back. Claude Code will retry, and the retry usually succeeds immediately — but it waits 180 seconds before giving up on the silent stream, and that wait is the whole cost. No hook fires while it happens (there is no event for a retry in progress), so the watchdog cannot resume its way out of this one. Cap the wait instead:
watchdog stall 60 # or /watchdog stall 60
watchdog stall # what is set, and what the session is actually using
watchdog stall off # back to 180s
That writes CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS into the env block of your
settings.json, which is the only way to reach the process: a hook cannot change the
environment of the session that spawned it. It applies to sessions started afterwards.
Claude Code clamps the value to 10s–30min, so watchdog stall refuses anything
outside that rather than writing a number that would be silently ignored.
Careful below ~45s: the same clock covers the wait for the first byte, which a large-context turn can legitimately exceed, and cutting that off turns a slow request into a retry loop. 60s is the useful setting; 10s is a foot-gun.
Measured, not inferred — against a local endpoint that accepts the request and then sends nothing:
CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS | request reissued after |
|---|---|
| unset | 180.1s |
20000 | 20.0s |
15000, via settings.json | 15.1s |
and the CLI reports stream idle: no bytes for 20000ms when it gives up. The related
CLAUDE_STREAM_IDLE_TIMEOUT_MS cannot do this: it is floored at 300s, so it only ever
makes the wait longer.
Claude Code ends a turn with one of two events, and the difference is the whole design:
| Event | Fires when | Can it block the stop? |
|---|---|---|
Stop | Claude finishes normally | yes |
StopFailure | the turn dies on an API error | no |
An API error fires only StopFailure, whose output is discarded. So a hook cannot
refuse to stop and cannot say "continue". The resume has to arrive from outside the
dead turn.
flowchart TD
A[Turn running] --> B{How did it end?}
B -->|normally| C[Stop fires — could block,<br/>but there is nothing to fix]
B -->|API error| D[StopFailure fires<br/>output ignored, cannot block]
D --> E[Hook can only write down<br/>what happened]
E --> F[Something outside the turn<br/>has to say continue]
Two halves. A resident relay that does nothing until spoken to, and a hook that only runs when something breaks.
sequenceDiagram
participant API
participant CC as Claude Code
participant Hook as watchdog.py hook
participant Sh as detached sh
participant Mon as monitor.sh<br/>(blocked on fifo)
participant Claude
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub fuadnafiz98/plugins --plugin watchdogPlugins from other owners that cover similar ground