/hermitd:reflectfrom hermitd
Pauses to reflect on recent work, detect patterns, and propose improvements. Runs prechecks, observations, and proposal tasks.
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, using bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts note .hermit <id> with the note on stdin. Otherwise skip record notes. Never edit a task file directly.
Pause and think about your recent work.
Silent by default. Only notify the operator (per § Operator Notification) if reflect produces an outcome: a proposal task, a graduated observation, or a cost spike.
Rare-branch procedures live in ${CLAUDE_PLUGIN_ROOT}/skills/reflect/branches.md. "Read branches.md § X" means: read that section now and follow it exactly — it is normative.
reflect-precheck: bun ${CLAUDE_PLUGIN_ROOT}/scripts/reflect-precheck.ts .hermit ${CLAUDE_PLUGIN_ROOT}update-reflection-state: bun ${CLAUDE_PLUGIN_ROOT}/scripts/update-reflection-state.ts .hermit/state/reflection-state.jsonroutines-health: bun ${CLAUDE_PLUGIN_ROOT}/scripts/routines.ts health .hermittask-report: bun ${CLAUDE_PLUGIN_ROOT}/scripts/task-report.ts .hermit --recent --limit 3observations-patterns: bun ${CLAUDE_PLUGIN_ROOT}/scripts/observations.ts patterns .hermitobservations-observe: bun ${CLAUDE_PLUGIN_ROOT}/scripts/observations.ts observe .hermitproposal-anchor: bun ${CLAUDE_PLUGIN_ROOT}/scripts/proposal.ts anchor .hermitproposal-gate: bun ${CLAUDE_PLUGIN_ROOT}/scripts/proposal.ts gate .hermittask-note: bun ${CLAUDE_PLUGIN_ROOT}/scripts/task.ts note .hermitBefore writing a quick-deferral or reflect-noticed row, run observations-patterns (Commands) once per run. Reuse an existing label that names the same component and failure; create a short stable label only when none matches. Use that exact label on stdin for each observation.
If $ARGUMENTS contains --quick, read ${CLAUDE_PLUGIN_ROOT}/skills/reflect/quick.md, follow it, and stop afterward.
If $ARGUMENTS contains --check-id or --check, read branches.md § Scheduled checks and follow it exactly, then stop (no precheck or numbered steps below). The invocation is reflect --check-id <id> --check <cmd…>: everything after --check is the skill command, including its arguments, verbatim. A routine owns the cadence and may pin the model for this invocation.
For every hermitd:reflection-judge call, include Task records: with the fresh
normalized adapter rows already read, preserving their source_path, outcome, title, lessons,
and waiting reason. Candidate Sessions: identifiers for record evidence are task IDs from those
source paths. A candidate
outside that bounded evidence set needs another targeted adapter read, not an archive fallback.
--precheck-verdict '<verdict>': the reflect routine already ran the precheck in bash; use <verdict> directly, do not re-run it (always status run; the routine stops on empty without loading this skill). Otherwise run it yourself and read its JSON:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/reflect-precheck.ts .hermit ${CLAUDE_PLUGIN_ROOT}
empty → nothing due; the precheck already updated reflection-state.json. Emit reflect: no candidates and stop.run → continue. phases lists due phases (cost_spike, behavior, compute, digest, newborn, observations_fresh); skip sections for phases not listed. observations_fresh means the ledger has rows newer than last_run_at; run step 3b even if compute is absent.bun ${CLAUDE_PLUGIN_ROOT}/scripts/task-report.ts .hermit --recent --limit 3 for the three most recent done, cancelled or unconfirmed records. Read task.ts list .hermit --open --json for the execution observation. Read fresh; never fall back to session archives.cost_spike is listed: the precheck already detected the spike and wrote the row (cost-spike:<YYYY-MM-DD> — the measured day, which is yesterday, carrying day_total and median_7d as fields), so there is nothing to read or record here — it graduates via step 3b like any other observation. Do not re-read cost-log.jsonl to restate a number the precheck already computed.3a. Behavioral digest — if behavior is listed: run bun ${CLAUDE_PLUGIN_ROOT}/scripts/transcript-digest.ts .hermit --record-observation (bounded ~20-line JSON of ground-truth counters — tool failures, tool_rejections by kind, wakes vs productive_wakes, compaction_events, subagent_dispatches; never Read a transcript directly). Two uses of the counters:
--record-observation makes the script write the defer-loop row itself when its own counters cross the threshold, citing the observed window.from→to span. Nothing to record here. (The flag is opt-in so an ad-hoc digest run stays a pure read.)tool_rejections.automode-blocked > 0; any single tool with tool_failures[tool] ≥ 5; compaction_events ≥ 3. A hit is a question for the gates (triage → judge), never a verdict — a quiet week with mostly unproductive wakes is legitimate, so the gates own false-positive pruning.3b. Observations ledger — prune, then graduate recurring patterns.
bun ${CLAUDE_PLUGIN_ROOT}/scripts/prune-observations.ts .hermit (fail-open).bun ${CLAUDE_PLUGIN_ROOT}/scripts/observations.ts graduate .hermit. It prints the patterns that cleared the session threshold and the graduation cursor this run: {"candidates":[{"pattern", "sessions": [...], "origin": "own-work"|"external-content", "rows": N}]}. Empty candidates means nothing graduated; continue.Evidence Source: archived-session, Evidence Origin: <origin>, Sessions: <sessions>, Artifact: state/observations.jsonl — pattern "<pattern>" in <sessions.length> sessions; route via § Candidate processing.skill-preference:<name>: Read branches.md § skill-preference:* routing and follow it.$GRAD_CURSOR (date -u +%Y-%m-%dT%H:%M:%SZ) and carry it to State Update. Do not write it yet: the cursor is written there, only on a clean run (§ State Update). Capture it here and write it in § State Update: rows Candidate processing appends after this point stay fresh for the next run, and a gate_failed graduation re-surfaces instead of waiting for a brand-new row.Phase: bind $PHASE to the precheck verdict's phase field (missing → adult, never block). $PHASE gates sub-threshold surfacing and the Progress Log annotation.
Tail the last 100 lines of state/proposal-metrics.jsonl (inline, single read): count created and responded events by source and action, triage-verdict events by verdict — feeds the operator-value and Component Health checks.
Dispatch the eval runner. Dispatch hermitd:skill-eval-runner pointed at ${CLAUDE_PLUGIN_ROOT}/skills/reflect/reference.md. The dispatch prompt carries: this run's Anchor: line as its first line (fields: bun ${CLAUDE_PLUGIN_ROOT}/scripts/proposal.ts anchor .hermit; non-zero exit → rerun with the absolute state dir the error names in place of .hermit, do not dispatch), plugin_root (resolved absolute path; ${CLAUDE_PLUGIN_ROOT} is not substituted in reference.md), the precheck's phases as phases_json, the execution observation from task.ts list (controls the routine check). The Anchor: line's memory_dir is the auto-memory directory reference.md expects under the name memory-dir.
Copy this skill's Commands entries verbatim into the dispatch prompt (already absolute); the runner uses them with the reference's arguments.
Failure policy: null/malformed runner JSON → fail open: skip the apply steps, carry forward empty candidate lists, do not advance the cursor, append [HH:MM] reflect — analysis-runner failed; introspection-only to the Progress Log, continue.
The eval runner return schema is in reference.md § Return Value.
Now reflect using inherited context only (normalized task records from step 2, cost shape from step 3, behavior digest from step 3a, metrics summary from step 5; the runner handled cross-session file analysis — do not re-read task records or proposal bodies). Signals: anything recurring or worked around instead of fixed? Spending proportional to the work — could a cheaper model tier have handled it; was context bloat avoidable? Something done manually that a skill covers (see branches.md § Learning-shape check), or a repeating subtask within the session a subagent could have handled? High dismissal rates signal noisy proposals; propose a concrete correction through the same consent path. If the execution observation is idle, think broader: a recurring check for HEARTBEAT.md, a missing operator preference (memory, or the skill owning the output), an agent to formalize a context-heavy sub-step, a manual request repeating on a schedule (routine-type candidate; branches.md § Candidate processing has the Type: routine Config-block format).
Is any skill, agent, or hook underperforming? Skills: output consistently corrected after use (answered from the lessons in the task records read in step 2)? Avoided for manual steps? Missed something it should catch? Disproportionate tokens for its value? Agents: flag reflection-judge when counters.judge_window.suppress > 2× counters.judge_window.accept and counters.judge_window.verdicts ≥ 5: the window holds the last 20 judge verdicts, so the flag clears on its own once the judge recovers. Read the ratio only from counters.judge_window, and when it is absent or unreadable do not flag; never fall back to the cumulative counters.judge_suppress/judge_accept tallies. This flag is audit-only: append ; component-health: reflection-judge suppress-ratio to the Progress Log line and nothing else. Flag proposal-triage when step 5's suppress > 2× create (≥5 verdicts): the gate may be over-strict. Hooks: out of scope (no telemetry): do not infer from side-effects; note as a known gap if suspected. Other Component Health findings become candidates (signal ladder + ## Skill Improvement format: branches.md § Candidate processing).
Collect all candidates first — think-hard observations, step-3b graduations, routine_candidates and procedure_candidates from the runner, Component Health findings. None → skip to State Update. Any → follow branches.md § Candidate processing exactly — read the file now only if step 3b's skill-preference:* branch didn't already load it earlier this run.
After each reflection run:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/update-reflection-state.ts \
.hermit/state/reflection-state.json \
'{"ran_with_candidates":<true|false>,"judge_accept":<N>,"judge_downgrade":<N>,"judge_suppress":<N>,"judge_suppress_by_code":{"no-evidence":<N>,"no-sessions":<N>,"covered-by-memory":<N>},"proposals_created":<N>}'
Then advance the step-3b graduation cursor: only on a clean run (nothing hit the gate_failed path this run), passing the $GRAD_CURSOR captured in step 3b. Skip the call otherwise: an unchanged last_graduation_at is what makes a graduated pattern whose candidate failed a gate re-surface on the next cycle (branches.md § Gate failure handling), and its rows are already durable in the ledger. Same rule as the quick-hash cursor. Omit the call entirely when step 3b did not run.
bun ${CLAUDE_PLUGIN_ROOT}/scripts/update-reflection-state.ts \
.hermit/state/reflection-state.json --graduation-cursor '<$GRAD_CURSOR>'
judge_suppress_by_code counts judge suppress verdicts by canonical code; omit zero-count codes, omit the key when judge_suppress is 0. Add "last_digest_at":"<now ISO>" only when a juvenile digest fired. Add "last_behavior_digest_at":"<now ISO>" whenever the behavior phase fired (step 3a): this advances its weekly cursor; omit it otherwise. The script handles counters, timestamps, since preservation, and atomic write. Counters are diagnostic, not audit-grade.
On every run reaching this point (not an empty verdict), append to the open task record through task.ts note:
[HH:MM] reflect (<phase>) — N candidates; verdicts: accept=A downgrade=D suppress=S; outcomes: <list or "none">
When suppress>0, append ; suppressed: [<slug>: <code>, ...]; canonical codes from the judge/triage verdicts (no-evidence, no-sessions, weak-recurrence, weak-consequence, not-actionable), capped at 3 with +N more. When the Component Health reflection-judge 2× flag tripped, append ; component-health: reflection-judge suppress-ratio. <phase> is newborn/juvenile/adult (step 4; a missing phase field annotates adult silently). This is the audit trail; the silent-by-default rule governs operator pings only; record the log line only inside an open record's 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?"./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.Other plugins' skills for the same job