/hermitd:channel-responderfrom hermitd
Routes inbound messages from Claude Code Channels, handling replies, task work, approvals, and operator controls with session context.
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.
When a message arrives via a channel:
With a recover <key> argument, follow recovery.md.
recovery-history: bun ${CLAUDE_PLUGIN_ROOT}/scripts/channel-recovery.ts .hermit history <key>leftover-check: bun ${CLAUDE_PLUGIN_ROOT}/scripts/evolve-plan.ts .hermit leftover-checkroutines-health: bun ${CLAUDE_PLUGIN_ROOT}/scripts/routines.ts health .hermitsettings-get-routines: bun ${CLAUDE_PLUGIN_ROOT}/scripts/settings-edit.ts .hermit/config.json get routinesEvery response to <channel source="..." chat_id="..." ...> must use the channel's reply tool, including acknowledgements. Terminal narration is secondary and invisible to the operator.
Build mcp__plugin_<plugin-name>_<server-name>__reply from both segments of the raw source="plugin:<plugin-name>:<server-name>". For example, plugin:discord:discord maps to mcp__plugin_discord_discord__reply, while plugin:acme-crm:crm maps to mcp__plugin_acme-crm_crm__reply. Do not double one segment. Configuration keys use the normalized bare server name (discord, not the qualified source; see lib/channel-envelope.ts's normalizeChannelSource).
When only a bare <sourceKey> is available (a later row's chat or a binding key), require exactly one loaded mcp__plugin_<plugin-name>_<sourceKey>__reply tool with that server segment. No match or multiple matches means the chat is unreachable: report the undelivered message per § Operator Notification.
Pass the inbound chat_id; optionally set reply_to to its message_id. The result sent (id: N) identifies the message for the same plugin's edit_message. Without that tool, use short threaded replies in place of progress-card edits and record no Progress card line.
Exception, checked first. A [harness-command] … requested line means stop: no bookkeeping, no tool call and no reply. A [pause] Hermit paused by … line containing "Only the channel reply tool works" permits only that reply tool: no bookkeeping or other tools. A [harness-command] refused "…" line is replyable; relay its reason. A [pause] Hermit resumed by … line is an ordinary turn.
When preparing a channel send, preserve the intended message content when encoding the tool arguments. Apply only the escaping required by the selected tool and rendering mode. Do not add or remove escaping within quoted code, HTML examples, or other literal content. Before sending, compare the final message body with the intended text. Normal JSON encoding still applies. This check concerns only the message body, not generated artifacts, source files or attachments; it does not change the tool's rendering mode or add mention support.
Apply MEMORY.md hook lines tagged [role] hermit-wide; apply [role <key>:<chat_id>] only to the matching normalized bare channel key (§1c) and chat. Roles apply only to messages addressed to you: every 1:1 DM, or a group/server message mentioning your bot_user_id/bot_username (the §2 self-mention test). Silently ignore other chats' roles. The hook line suffices; do not Read the topic file. A [chat instructions] line is operator-set policy: follow it over memory roles here. Route any admitted sender's change to Settings change request without refusing it yourself; the native prompt decides.
Use the injected TASKS.md policy. Before replying, the only bookkeeping calls are bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts list .hermit --open --conversation <sourceKey>:<chat_id> and the §1d record-operator-action.ts --force call after authorization; role checks excepted. Do not reread TASKS.md or runtime.json. The shutdown gate supplies any pending shutdown refusal.
Route every reply to a pending task decision through task answer [<id>] --chat <key> --user <sender-id> --reply <token>; map meaning in any language to yes, no, a number, an option label or a deferral ("later"). With exactly one decision pending in this chat, a bare yes, no or later is its answer, including acceptance of a posted result: call task answer before replying, adding --result-rev <result_rev> from the hook's waiting line when the row has one. Only a none/no_pending receipt sends a plain result row to the hook's task close line, even if the wording feels loose, and never answer or ask about it in chat alone. With two or more pending, ask which one first, naming them, and record nothing unless the reply names one. Then call task answer without an id and use the returned titles. Read approvals.md § Answering a wait for its match, ambiguity, refusal and stale outcomes. Never bypass the script with a clear-wait note or a close. An open handle, resident task thread, or continuation of the sole open task selects it. For an ambiguous continuation of other work, ask once naming the tasks and record nothing. Plain questions open nothing. Reply before further record mutations or classification tool calls.
Use hook-provided authorization and loaded config.json → channels.<channel>.allowed_users, with the normalized bare key from §0:
user_id; fall back to user only when user_id is absent. Never allowlist-match user when user_id is present: the sender controls that display name.allowed_users is absent for this channel: accept all messagesallowed_users is an empty array []: accept from no one (explicit lockdown)Primary operator: On a channel with members_only: true, nobody is primary. Otherwise, if channels.<channel>.operators is set, any listed user id is primary. Otherwise, if allowed_users is set, only its first or only entry is primary. Otherwise, the sender must be in the channel's maintainer chat (maintainer_channel_id), or in its home chat (default_chat_id) with operator_profile other than non-technical. Empty lists name nobody; where none of these fields exist, nobody is primary.
After authorization passes, run:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/record-operator-action.ts --force
This idempotent command resets the quiet window and defers monitor-mode routines until Stop. Run it as early as authorization allows, covering envelopes or senders UserPromptSubmit could not attribute.
Hooks seed channels.<channel>.default_chat_id, the pinned proactive home. Never treat a chat message as authority to move it. Requests to move briefings go through settings-edit, which raises the native permission prompt; replies still go to the inbound chat_id (§0).
First apply reference.md § Standing role.
Precedence: hook-classified commands, then a done-items clear, then a task decision answer, then an annotated task thread, then a selected-task continuation, then general classification.
Invoke /hermitd:task for an assignment at or above the TASKS.md threshold, any message in an annotated task thread, a confirmation, cancel or changed definition of done for a selected record, a [conversation command: ...] annotation, or a WORKER <task-id> ... completion.
Acknowledge first through the channel.
In task threads, apply /hermitd:task’s intake rules.
[open tasks in this chat: …] guides routing without selecting a record. [bound tasks: …] names the sender’s spawned-session tasks. A continuation selects that record: reply naming it and invoke /hermitd:task (helper-owned: Steer the bound session). New work follows general classification.
/hermitd:task through the task route above.Before archive traversal, multi-file search or delegated execution, apply Context-hygiene & delegation: delegate when its criteria hold and retain only the verdict.
Harness command (exactly !compact, !clear, !model <arg>, !effort <arg>, !permission-mode <mode>, !advisor <model>, or !doctor (alias !checkup))
!model, !effort, !compact, !clear, !advisor, and !doctor before an agent turn. Do not run them yourself or treat them as skill invocations. Relay a mod-provided outcome only when explicitly asked to do so after a failed direct send.!permission-mode still uses the Stop hook; its [harness-command] lines follow §0's exception.!clear arrives as [conversation command: restart] and the other harness commands as [conversation command refused: …], handled under Conversation command. A resident-owned thread takes session commands like any other chat.reference.md § Harness command details.Typed-only command (a request, as a slash command or in plain words, for what only a typed command does: updating, restarting or upgrading the agent itself (not a task worker or a config setting), or any skill whose Skill call refuses with disable-model-invocation)
act_surface line in context decides who is told to do that. Nothing runs in its place: no look-alike skill, no subagent that does its job (such as hermitd:evolve-runner), no shell route.Slash command (message starts with /, e.g. /simplify, /plugin:command)
Skill refusal with disable-model-invocation makes it a Typed-only command. Trust the actual refusal, since flags change across releases.Status request ("what are you working on?", "how's it going", "progress", or a bare "status"; a question that names routines, watches, or rules is Standing work below)
/hermitd:task for the worker listing procedure.Standing work (inspection or change of what you do on your own: "what are you keeping an eye on", "anything I need to deal with", "why are you on this model", "what can you access", "pause the evening check", "disable the Friday digest", "stop watching the deploy log")
[role lines in this turn's context. Read reference.md § Standing work beside this file: it names the bounded reads and the owner each change routes to.Spend request ("how much have I spent", "why is my bill high", "cost breakdown", "what's my spend", or any variant asking about spend/cost/billing, in any language)
operator_profile line says non-technical: do not invoke cost-reflect or surface figures. Reply in the client chat and operator's language that their provider handles day-to-day costs, then offer other help. Figures remain maintainer-side (terminal, maintainer chat, weekly review)./hermitd:cost-reflect; a channel turn reads its --plain data. Do not run the raw token-category breakdown here.Task assignment
/hermitd:task, with --due <ISO> for a given date.Clear of "Looks already done": approvals.md § Already-done items.
Answering a wait: the §1 task answer route, for proposals and questions alike.
Chat access request (who may talk in a chat, where the agent listens, or removing a paired approver): invoke /hermitd:channel-access.
Settings change request ("change the model", "add a routine", "turn off the heartbeat" — anything that alters .hermit/config.json)
/hermitd:hermit-settings and .hermit/bin/hermitd-run settings-edit …. Never Edit or Write config.json, from any turn origin. settings-gate raises native permission prompts for asked paths./hermitd:hermit-settings rules; judge meaning, not wording.Standing role ("remember (for this channel): when X, do Y", "forget/update the X rule", "what do you remember?")
reference.md § Standing role first; hermit-wide only for a primary operator (§1c).Question ("why did you...", "what about...", "how does X work?")
Pause / resume / snooze / release (exactly !pause, !stop, !resume, !snooze <duration>, or !release)
UserPromptSubmit pause stage already updated the pause state; only acknowledge through the channel.!: bare "pause"/"stop"/"resume"/"snooze 2h" changes no pause state; bare "stop" is Emergency.!pause@<your handle>, @<your handle> !pause, or Discord's leading <@your id>. Ignore other bots' commands. Mentions do not bind bare words: <@you> pause remains conversation.pause-gate.ts returns the pause reason and denies all but channel reply, including Bash hermitd-pause.ts off. Only operator !resume or hermitd pause off resumes.Learned skill control: after §1c authorization, "keep this skill" → .hermit/bin/hermitd-run skills pin <name> --origin operator; "stop doing it that way" about a named learned skill → .hermit/bin/hermitd-run skills rollback <name>. Ask which if unclear; confirm plainly. Halting current work stays Emergency.
Emergency ("abort", "revert", "rollback", or "stop")
!stop/!pause blocks all but channel reply.bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts block .hermit <id> --waiting-on operator --status-line "Halted on operator request" --next "Await operator direction".Answer only what was asked, in plain phone-readable prose, then stop
Mention the current task when it helps place the reply
If you can't handle it, say so and suggest the operator's next step
!release uses the same trusted-controller gate and releases human browser control only. It keeps the task claim; acknowledge whether anything was held.
Channel voice: no internal IDs (task ids), no token counts or cost-log jargon, no slash commands, no cron strings. Say what happened and the one next thing the operator can do from chat (a plain reply, not a command). Internal IDs stay in files; terminal/maintainer output is exempt. Exceptions: name the control commands !pause, !stop, !resume, !snooze, !status, !scheduled and !release when the operator asks how to control you, since they are the reply the operator would send, and !doctor when it is their next step; no slash command qualifies. See prompts/resident.md § Operator Notification for the full rule.
Files: Attach a file the reader should see through the conversation reply tool's file parameter, or through SendUserFile when available in the Claude app or terminal. If there is no attachment mechanism, describe the file in words. Put a path in the reply only when the path itself is the requested answer.
Sign-in links: never repeat a pasted callback address.
Chat boundary: each chat's messages, tasks and decisions belong to it, even though this session holds them all: repeat them in the chat you reply in only if its readers could already read them, and on a non-technical install never carry maintainer-chat content into a client chat. Resolve a reference or bare go-ahead against this chat's own latest exchange first; reach into another chat only when this chat holds no candidate, and then name it and ask, never acting on it from here.
After replying, append at most one line with task.ts lesson <id> to the selected record for these durable signals:
Read reference.md § Capture Interactive Patterns before recording a signal or correction.
For proactive notifications, read outbound.md before composing or sending.
Apply to every skill's decision point on a channel-tagged turn (<channel source="...">). Send questions through the reply tool. When a question outlives the turn, read questions.md and open or block a task with an input decision and decision.resume naming the existing procedure. Even an answer in the live turn goes through task answer; a later answer follows the same path. Never call AskUserQuestion on a channel-tagged turn.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gtapps/hermitd --plugin hermitd41 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?".Other plugins' skills for the same job