prime-agent

Use on scheduled-agent wake or lean prime restart - replaces the full thrum prime briefing with a lean two-step warmup tuned for short-lived scheduled-agent invocations. Step 1 reads the inbox literal

SKILL.md

GitHub

Thrum: Prime Scheduled Agent (Lean)

This skill is the wake-time variant of thrum prime for scheduled agents. Full thrum prime is too heavy when the agent is going to run for a few minutes and then exit — but the two pieces of state that matter MUST run literally, not as a discipline.

Step 1: Read the inbox

Run this exact command. Do not skip it. Do not defer it.

thrum inbox --unread

This is a hard-required step (not a discipline assumption). The agent.wake message that triggered this session lives in the inbox; the wake-primer payload + any operator escalations land there too. Reading the inbox is how the agent learns WHY it was woken and WHAT the primer said.

If thrum inbox --unread returns no messages, the agent was likely woken without a wake message (manual restart, daemon error). In that case, continue to Step 2 — the skill-library check is still useful — but flag the missing wake message in the status report at end of session.

Step 2: Skill-library check

Run this exact diff against the last-seen skill set, then write the current set back so the NEXT wake compares against THIS wake.

ls .claude/skills/ > /tmp/current_skills.txt
AGENT_NAME=$(thrum whoami --field agent_id)
LAST_SEEN=".thrum/agents/${AGENT_NAME}/last_seen_skills.txt"
if [ -f "${LAST_SEEN}" ]; then
  diff "${LAST_SEEN}" /tmp/current_skills.txt || true
else
  echo "First wake for this agent — full skill library:"
  cat /tmp/current_skills.txt
fi

# Update last_seen_skills.txt — this wake's skill set becomes the
# next wake's baseline. Do this AT BOOT (not at end-of-session) so
# the next wake's diff surfaces only what's truly NEW since this
# boot, not since end-of-session (which might be drift-free if no
# new skills shipped during the session).
#
# Atomic write via temp-file + mv. A crash mid-cp would leave a partial
# last_seen_skills.txt; the next wake's diff would then emit
# "all skills new" (false-positive drift). Temp+mv eliminates the
# partial-write window.
mkdir -p ".thrum/agents/${AGENT_NAME}"
cp /tmp/current_skills.txt "${LAST_SEEN}.tmp" && \
  mv "${LAST_SEEN}.tmp" "${LAST_SEEN}"

When a new skill ships to .claude/skills/, the next wake's lean-prime surfaces it. Writing last_seen_skills.txt at the END of Step 2 (after the diff) means each wake updates its own baseline — the diff at wake N+1 reflects what's NEW since wake N's boot, regardless of mid-session skill drift.

Do not skip this step even if Step 1's inbox was empty. Skill drift between wakes is a real failure mode — agents can miss a critical new skill if the lean-prime suppresses the diff during quiet sessions.

When NOT to use this skill

This is the SCHEDULED-AGENT wake variant. If you're a coordinator or a human-operator-spawned agent, use thrum prime instead — the full briefing covers team state, project state, work context, and recent commits that the lean variant skips. The lean variant exists because scheduled agents run for a few minutes and exit; the full briefing's setup cost isn't recouped over the session lifetime.

If the session will exceed ~30 minutes, or coordination with other agents is needed, defer to thrum prime.

Exception: post-/thrum:compact resume — MANUAL FALLBACK ONLY. After /thrum:compact or /thrum:compact, the SessionStart hook now auto-injects a zero-turn light briefing (thrum prime --light) directly into context on a healthy daemon — no turn spent reading a file or running a skill. This skill is the correct choice here only as a fallback, when that auto-injection didn't fire or failed (e.g. the hook's "auto-injection failed" notice, daemon unreachable). In that fallback case: read the snapshot first, then run this skill. See /thrum:compact's "How resume works" section.

After Step 2

Once both steps complete, proceed with the work the wake-primer asked for.

The former agent-state update and recovery skills were retired. Personal continuity now uses thrum state (personal_state kind). The last_seen_skills.txt baseline write in Step 2 above is unaffected.