/hermitd:watchfrom hermitd
Manages background event watches via config monitor or ad-hoc Monitor tool. Supports stream and poll classes for file, WebSocket, and script-based monitoring with zero-token silence.
Ships in hermitd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Record notes only inside an open record's turn: task-note (Commands), arguments <id>, note on stdin. Otherwise skip notes. Never edit a task file directly.
Run config watches under the background watch monitor; ad-hoc watches use the CC Monitor tool. Each stdout line becomes a conversation notification. Silence costs zero tokens.
Classes:
tail -f, WebSocket, fswatch). Event-driven.task-open: bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts open .hermittask-block: bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts block .hermittask-list: bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts list .hermittask-receipt: bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts receipt .hermittask-note: bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts note .hermit/hermitd:watch <instruction> # requested watch: saved; step of other work: temporary
/hermitd:watch <stream-command> # start ad-hoc stream
/hermitd:watch enable <id> --answer <a> # [internal] turn on a staged watch (config-watch.md)
/hermitd:watch session <name|glob> [note] [--record <T-id> --prior-report <id|null>] [--proposal <task-id>] [--fresh-launch] [--implement] [--retry] [--id <bg-id>] # watch local session(s) until their next idle notice
/hermitd:watch notice <text> # [internal] handle a watched-session or cloud-report notice
/hermitd:watch start # activate the config watch monitor
/hermitd:watch stop [id] # stop by id (or auto if 1 ad-hoc watch)
/hermitd:watch stop --all # stop all ad-hoc watches
/hermitd:watch status # list config and registry watches
For ad-hoc and session watches, .hermit/state/monitors.runtime.json is the sole source of truth. Config watches are declared in .hermit/config.json; the watch poller writes their observed state to .hermit/state/watch-monitor.runtime.json.
{
"monitors": [
{
"id": "deploy-errors",
"task_id": "bmg9y1le3",
"command": "tail -f deploy.log",
"timeout_ms": 1800000,
"description": "errors in deploy.log (notify with --watch deploy-errors)",
"started_at": "2026-04-12T15:00:00Z",
"source": "adhoc",
"class": "stream"
},
{
"id": "session-migration-1775991600-b7c1",
"description": "database migration",
"target": "migration",
"started_at": "2026-04-12T15:00:00Z",
"source": "adhoc",
"class": "peer-idle",
"records": [{"record": "T-20260412-150000", "prior_report": null}]
}
],
"last_cleared": "2026-04-12T15:00:00Z"
}
The linked session and notice procedures are required. Read the matching file before acting. After compaction, re-read it and the current registry; resume at the first unfinished step using recorded results. Never repeat completed subscriptions, notifications or record writes.
peer-idle entry.Route by purpose, even inside a task thread: if the watch itself is the request, read config-watch.md and save it. A watch that is a step toward another outcome stays temporary. For enable, read the same file.
adhoc-<epoch>-<4char-random> (e.g., adhoc-1744460400-a3f2).
Timestamp + randomness avoids cross-session collisions..hermit/bin/hermitd-run watch-poll <id> --every <interval> -- "<check>"
Quote the check as in config-watch.md § Create step 2.description: the operator's instruction text plus (notify with --watch <id>) (shown in every notification)command: the constructed commandtimeout_ms: min(config.timeout_ms ?? 1800000, 1800000)state/monitors.runtime.json (create if missing: {"monitors": [], "last_cleared": null})monitors[] with source: "adhoc", the returned task_id, and the exact command, description and timeout_ms used for registration. On a channel turn from a chat other than that channel's home chat (default_chat_id), record chat: "<sourceKey>:<chat_id>" for the asking chat if the channel is Discord, Telegram, or has send_script. Otherwise omit chat. An ad-hoc watch never records a different chat.bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts note .hermit <id> <<'HERMIT_LINE'
- [ACTIVE] <instruction> (started HH:MM)
HERMIT_LINE
For /watch session, read session-watch.md § Starting a session watch before acting.
/watch start)At boot or manually.
/hermitd:watch-activate, including when no config watches are enabled. Repeated invocation keeps the existing monitor.config.json → monitors[] and state/watch-monitor.runtime.json. Report each enabled config watch's observed state: running with pid and start time, waiting to restart after an exit, or pending reconciliation when absent. The poller owns this runtime file.--all flag. With --answer, stop only on a yes.stop <config-id>, find the entry's zero-based index in config.json → monitors[] and run:
.hermit/bin/hermitd-run settings-edit .hermit/config.json set monitors.<n>.enabled false
The owning chat can stop silently in auto mode; other writes may raise a native prompt. A No is final: leave the watch enabled and do not try another write path. The poller stops the child on reload; the disabled state persists across boots.TaskStop on its task_id and/or poll_task_id when present, then remove its entry. If the task already exited, remove the stale entry anyway.stop without an id considers only ad-hoc registry entries (source: "adhoc"), including peer-idle. With none, report no active ad-hoc watches; with one, stop it; with several, ask which one or offer --all.stop --all stops and removes only ad-hoc registry entries. Config watches remain enabled.Read config.json → monitors[], state/watch-monitor.runtime.json, and state/monitors.runtime.json. Merge config watches with ad-hoc and session registry entries. Show each id, source, class, description, and observed state, including disabled config entries and enabled entries pending reconciliation. For running config watches include pid and start time; for exited watches, exit code and restart count. Show peer-idle as the class for session watches. If all sources are empty, report no watches.
For REPORT_STORED, CLOUD_REPORT_STORED or CLOUD_REPORT_FAILED, read notices.md § Handling report notices.
For a background completion matching poll_task_id, read notices.md § Handling helper poll exits first.
Check Monitor expiry below before self-exit. For other Monitor completions, read
notices.md § Handling self-exit notifications. For a watched-session idle
or subscription-expiry notice, read notices.md § Handling idle notices.
Read the matching section before acting.
/watch notice <text>)Expiry handling applies only to Monitor entries in the ad-hoc/session registry. Config watches have no expiry and need no re-arm.
Before reading a notice procedure, inspect the harness task-notification. When its
event body starts with Monitor expired after (inside the host's surrounding
square brackets), treat it as an expiry notice. Use its task-id only to match a
current Monitor entry in state/monitors.runtime.json; never match by description
or watch id.
command, description and
timeout_ms with the Monitor tool.task_id with the returned id and write the registry back.
Preserve its other fields. Return without reading notices.md.config.json change. Enabled watches restart after any command exit, with backoff; WATCH_MONITOR_ERROR reports the first exit of each failure episode, and a run of ten minutes or more ends the episode. Do not re-register them through the Monitor tool.description, command and timeout_ms (cap 1800000 ms). Resolve plugin-root placeholders before registration; the plugin-root variable is not exported to Monitor subprocesses.grep --line-buffered in pipelines so events arrive promptly, and emit stdout only on a genuine change or event.|| true only for expected errors that should not fail a stream command.inotifywait (inotify-tools, in the base image), not macOS-only fswatch./clear and compaction leave surviving watches alone.Pass --watch <id> to every bun ${CLAUDE_PLUGIN_ROOT}/scripts/channel-send.ts .hermit --notice reporting a stream/poll watch's events, before removing its entry. Session watches keep their record-thread routing.
When a watch event is handled, run bun ${CLAUDE_PLUGIN_ROOT}/scripts/duties.ts record .hermit watch <id> --verdict <verdict> before removing a consumed entry. This writes last_event_at and last_verdict to state/watch-duties.json for a config id, or to its registry entry for an ad-hoc id; listings are labeled since session start. When a config watch event meets its description's end condition, report it, then follow config-watch.md § Met. Otherwise leave it running.
Read TASKS.md. If a finding requires a human and config.tasks.duties_open_records is true, use bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts open .hermit --requester duty:watch --title ... --done ... --due <ISO> --dedupe-key duty:watch:<watch-id>:<event-key> and bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts block .hermit <id> --waiting-on <human> --status-line ... --next .... Post the stall notice only on created:true; repeated open digests refer to the same record. Otherwise post plain messages. A verified resolution closes only its matching record with bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts close .hermit <id> --by check --actor duty:watch; ambiguous reads never close records.
What SKILL.md sets; muted values are Claude Code's defaults
41 skills in this plugin
/briefReturns a 5-line executive summary of recent work. Checks open records first, then recent task outcomes. Activates on messages like "brief", "what happened", "morning update", "overnight summary", "progress", "what are you working on", "how's it going"./browserDrives the agent's own browser, or the operator's Chrome for their accounts. Use before giving steps that send someone to a web console to create or change something on an account (an API key, a bot, an app registration), even when the person will do them by hand or no browser is available. Also use when WebSearch fails, or when WebFetch cannot read a page: it is refused (such as 402 or 403), stays rate-limited after a retry, times out, or returns an empty page, a JavaScript-only shell, or a block notice in place of the content asked for. Use it before answering from other sites or searches, above all when the person named or linked the page, even if the browser may be off. Also use when a page needs clicks, forms, scrolling or sign-in; or when a screenshot or exact rendered text is needed. Public read-only lookups start with WebSearch or WebFetch./capability-brainstormMonthly routine plus on-demand hermit-voice brainstorm — synthesizes memory, capabilities, recent artifacts, and codebase shape into at most 2 capability ideas, each gated by proposal-triage before becoming a proposal task. Runs on the capability-brainstorm routine and when the operator asks to brainstorm capabilities or ideate, e.g. "brainstorm capabilities", "any capability ideas?"./channel-accessManage chat access. Let someone talk in a chat, remove them, see who can talk here, open a chat to everyone, turn a chat off, or remove someone who is no longer an approver./channel-responderHandles inbound messages tagged <channel source=...> from Claude Code Channels, routing replies, task work, approvals, and operator controls with session context./channel-setupGuided channel activation for local/tmux users; adds a channel entry when none is configured, installs the plugin, configures the bot token in the project-local state dir, and walks through pairing. Run after hatch, or any time to add or re-enable a channel.npx claudepluginhub gtapps/hermitd --plugin hermitdOther plugins' skills for the same job