plugins/claude-code-hermit/skills/session/SKILL.md
Start or resume a work session with full context loading and work tracking. Use at the beginning of work.
npx skillsauth add gtapps/claude-code-hermit sessionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Start or resume a session with full context loading. This is the generic session workflow — hermits may provide specialized versions.
Invoke /claude-code-hermit:session-start to check session state and load context.
TaskList to see current plan stepsblocked: suggest running /debug to diagnose tool/hook failures before re-attemptingOnce I know what to work on:
TaskCreate) for each stepTaskCreateWork through tasks using whatever tools, skills, and agents are available:
TaskUpdate) when starting each step, completed when done.claude-code-hermit/sessions/SHELL.md Progress Log after each significant stepWhen the work is done, or the operator decides to move on (even if partial or blocked):
Completion notification is the final step of this flow, not a substitute for it. Skipping the idle transition (step 6 below) leaves the session in_progress, which triggers stale-session heartbeat alerts and delays report archival until the time-based backstops kick in.
Compile final session data in context — do NOT write to SHELL.md at this point. session-archive.ts owns the final write. Gather:
Status: one of completed | partial | blockedBlockers: one line each, enough context for a cold startLessons: only genuinely useful onesChanged: list of files modifiedVerify quality in-context before archiving:
completed | partial | blockedCreate proposals for any high-leverage improvements discovered during work
Reflect (with debounce). Read state/reflection-state.json for last_reflection. Only invoke the claude-code-hermit:reflect skill if last_reflection is null or older than 4 hours. For quick tasks (no tasks created, under 5 minutes), skip entirely — progress log is sufficient.
4b. Session-triggered scheduled checks. For each scheduled_checks entry (from config already loaded) with trigger: "session" and enabled: true, invoke the skill. If a skill is unavailable or errors, skip it and continue — never block session finalization on a scheduled check failure. For each check that completed successfully, run bun ${CLAUDE_PLUGIN_ROOT}/scripts/update-reflection-state.ts .claude-code-hermit/state/reflection-state.json --scheduled-check-run <id> (writes only that check's last_run; fail-open). Do not run it for failed checks.
If native Tasks exist: call TaskList, format as a markdown table. Then TaskUpdate(status=deleted) for all tasks (idle = clean slate).
Run scripts/session-archive.ts to perform an idle transition (finalize SHELL.md, archive report, reset task-scoped sections, set session_state to idle). It derives cost itself from the cost-log window — no Cost: line to compute or pass.
Pipe the following compact structured payload on stdin — keep it brief, no freeform prose:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/session-archive.ts archive --mode=idle --state-dir=.claude-code-hermit <<'HERMIT_PAYLOAD'
Status: <completed|partial|blocked>
Blockers: <one line each, or none>
Lessons: <one line each, or none>
Changed: <file list, or none>
## Plan
<task table, if native Tasks were created>
HERMIT_PAYLOAD
Parse the single line of JSON the script prints to stdout. Gate every following step on the returned ok field. ok === true → the transition succeeded, continue to step 7. ok === false → the archive did NOT happen — do not proceed as if it did. Append the returned reason to SHELL.md ## Findings and retry once; if it fails again, notify the operator and leave the session in_progress rather than silently losing the report.
If heartbeat.enabled is true in config and heartbeat is not already running: start it (/claude-code-hermit:heartbeat start)
7b. Compaction boundary marker (now automatic). The step-6 idle archive itself wrote state/compact-requested.json (see markers.compact_requested in its output) — the archived arc is fully on disk, so the watchdog's routine-hygiene compactor (maybeContextCompact) may waive its interval cooldown on the next tick. The marker is self-reaping: maybeContextCompact consumes it when the compaction fires and deletes it stale-on-read past COMPACT_MARKER_TTL_SECS, and session-start step 3 unconditionally deletes any survivor on boot as a backstop. Nothing to do here.
After the idle transition (step 6) succeeds (ok === true), check .claude-code-hermit/sessions/NEXT-TASK.md and read escalation from config:
Delivery-moment voice rule for both branches below: compose the notification in owner language — no S-NNN, no internal IDs, no file paths, no slash commands. Lead with what was delivered. If this task produced a durable compiled/ output (you already know this from your own context — it's whatever you just wrote this task, the same thing session-archive.ts is about to cite in ## Artifacts), name it plainly in one clause (e.g. "Done — investigated the login bug. Prepared: a summary of what's causing it."). If the task produced no compiled/ deliverable, state the one-line outcome instead (e.g. "Done — fixed the login redirect bug.").
escalation is balanced or autonomous: notify the operator: "Done — [task]. [Prepared: <deliverable> | <one-line outcome>]. Starting on [NEXT-TASK.md summary] next." Then, as the terminal action of this flow, invoke /claude-code-hermit:session-start (no --task flag — it consumes NEXT-TASK.md itself via its own step 6). Do not perform any further steps of this invocation's flow after invoking it. Under autonomous, once that drained task completes, re-run this Work-done flow on it in turn (same as heartbeat's existing autonomous NEXT-TASK pickup) — never leave it silently in_progress with only a bare notification.escalation is conservative): notify the operator: "Done — [task]. [Prepared: <deliverable> | <one-line outcome>]." Append "Ready for what's next." only when no task is queued — omit that tail under conservative with a task queued, since a task IS pending and the tail would falsely imply an empty queue. Under conservative with a task queued: leave NEXT-TASK.md in place — do not auto-start it, do not mention the queued task here, and do not write to runtime.json from this flow (session_state/waiting_reason writes belong to session-archive.ts/heartbeat/channel-responder, not this skill). The existing heartbeat Idle Agency drain owns the single operator-facing queue notice: on its next tick its conservative branch notifies about the queued task and sets waiting.Once the operator says what's next (or, in the auto-start branch above, once the drained task's own plan is underway): go to step 4 (plan the work)
To close the session entirely, the operator runs /claude-code-hermit:session-close at any time.
/claude-code-hermit:proposal-create./claude-code-hermit:watch./claude-code-hermit:brief.tools
Composes and delivers the daily fitness brief — a forward-looking morning read (readiness + today's plan) or a backward-looking evening read (today's training, or an earned-rest note, + tomorrow's setup) — in the operator's configured voice. Invoke with /claude-code-fitness-hermit:fitness-brief --morning|--evening|--slot <name>. Becomes the plugin's two daily beats — the morning Strava connectivity check and the evening activity sync, RPE binding, and Run deep-dive.
development
Renew the hermit's long-lived Claude login token over the channel, before it expires. Relays a one-time sign-in link to the operator, takes the code back, installs the new token, and restarts. Activates on messages like 'relogin', 'renew my login', 'reauth', 'the login is expiring', or when doctor's credential-expiry check flags setup-token.
development
Synthesizes the past 7 days of archived briefs into a weekly digest — top stories, emerging vs faded themes, category activity, and per-source performance built from archive frontmatter. Delivers to the operator's configured channel and archives a weekly note. Designed as a weekly routine. Invoke with /feed-hermit:weekly-digest.
development
Manage developing story arcs tracked across briefs — add, resolve, and list active arcs in compiled/story-arcs-*.md. Arc Watch keywords drive the feed-brief arc-tagging enrichment. Invoke with /feed-hermit:story-arcs add|resolve|list.