Heartbeat — Session Startup
Execute the following steps in order. Do not skip steps. Do not ask permission.
Step 1: Load Identity
- Read
context/SOUL.md — who you are, how you behave
- Read
context/USER.md — who you're helping and their preferences
Step 2: Load Memory
- Read
context/MEMORY.md — long-term curated knowledge (main sessions only)
- Read today's daily file:
context/memory/{YYYY-MM-DD}.md
- Read yesterday's daily file:
context/memory/{yesterday's date}.md
If either daily file doesn't exist, that's fine — skip it silently.
Step 3: Load Workflow Config
- Read
workflow.json if it exists — note the docs repo name and project type
- If
workflow.json exists, this is a workflow-enabled project:
- Resolve the docs repo path: if
docsRepo is "." this IS the docs repo;
otherwise run pwsh .claude/skills/tool-worktree/scripts/resolve-repo.ps1 <docsRepo>
to find the actual path (works in bare+worktree, agentsandbox, and normal clones)
- Note the resolved docs repo path for later reference
- Skills that generate documents will output to the docs repo
- The
docs.output paths in workflow.json are relative to the resolved docs repo root
Step 4: Create or Append Daily Memory
- If
context/memory/{YYYY-MM-DD}.md does not exist, create it:
# {YYYY-MM-DD}
## Session 1 — {HH:MM}
### Goal
[Pending — awaiting user goal]
If it already exists (second+ session today), append a new session header:
## Session {N} — {HH:MM}
### Goal
[Pending — awaiting user goal]
Step 5: Freshness Check
- Check modification dates on all files in
context/:
- If any file is older than 30 days, flag it:
"Your [filename] is from [date]. Want to refresh, or keep going?"
- If
context/memory/ has daily files older than 30 days that aren't archived,
suggest archiving them to context/memory/archive/.
Step 6: Documentation Status (if workflow-enabled)
- If
workflow.json exists and has a docsRepo path:
- Check what docs were recently created or modified in the docs repo
(last 7 days: ADRs, RFCs, design docs, etc.)
- Check recent session notes for decisions that might need an ADR
- If any recent decisions lack a corresponding ADR, note it:
"Decision from [date] about [topic] — should this be an ADR?"
- Briefly list available document types: "You can generate PRDs, RFCs,
ADRs, design docs, C4 diagrams, runbooks, post-mortems, and spike reports."
Only surface documentation status if there's something actionable. Don't list
document types every session — only on first session or if asked.
Step 7: Skill Inventory
- List available skills from
.claude/skills/ (names and one-line descriptions only).
Note any skills that were recently added or modified.
Step 8: Greet
- Greet the user briefly. If recent daily files contain relevant context (open items,
ongoing work), mention it. Keep it to 2-3 sentences max.
Example: "Morning. Yesterday you were working on the event sourcing migration —
left off at the projection rebuild. You also made a decision about caching strategy
that might need an ADR. Ready to continue, or something new?"
1---2name: meta-heartbeat3description: Session startup ritual that loads context files, creates daily memory, checks for stale context, and surfaces documentation status. Runs automatically at the start of every session, or invoke manually with /meta-heartbeat to re-initialize context. Does NOT trigger for mid-session work.4---5
6# Heartbeat — Session Startup
7
8Execute the following steps in order. Do not skip steps. Do not ask permission.
9
10## Step 1: Load Identity
11
121. Read `context/SOUL.md` — who you are, how you behave
132. Read `context/USER.md` — who you're helping and their preferences
14
15## Step 2: Load Memory
16
173. Read `context/MEMORY.md` — long-term curated knowledge (main sessions only)
184. Read today's daily file: `context/memory/{YYYY-MM-DD}.md`
195. Read yesterday's daily file: `context/memory/{yesterday's date}.md`
20
21If either daily file doesn't exist, that's fine — skip it silently.
22
23## Step 3: Load Workflow Config
24
256. Read `workflow.json` if it exists — note the docs repo name and project type
267. If `workflow.json` exists, this is a workflow-enabled project:
27 - Resolve the docs repo path: if `docsRepo` is `"."` this IS the docs repo;
28 otherwise run `pwsh .claude/skills/tool-worktree/scripts/resolve-repo.ps1 <docsRepo>`
29 to find the actual path (works in bare+worktree, agentsandbox, and normal clones)
30 - Note the resolved docs repo path for later reference
31 - Skills that generate documents will output to the docs repo
32 - The `docs.output` paths in workflow.json are relative to the resolved docs repo root
33
34## Step 4: Create or Append Daily Memory
35
368. If `context/memory/{YYYY-MM-DD}.md` does not exist, create it:
37
38```markdown
39# {YYYY-MM-DD}
40
41## Session 1 — {HH:MM}
42
43### Goal
44[Pending — awaiting user goal]
45```
46
47If it already exists (second+ session today), append a new session header:
48
49```markdown
50
51## Session {N} — {HH:MM}
52
53### Goal
54[Pending — awaiting user goal]
55```
56
57## Step 5: Freshness Check
58
599. Check modification dates on all files in `context/`:
60 - If any file is older than 30 days, flag it:
61 "Your [filename] is from [date]. Want to refresh, or keep going?"
62 - If `context/memory/` has daily files older than 30 days that aren't archived,
63 suggest archiving them to `context/memory/archive/`.
64
65## Step 6: Documentation Status (if workflow-enabled)
66
6710. If `workflow.json` exists and has a `docsRepo` path:
68 - Check what docs were recently created or modified in the docs repo
69 (last 7 days: ADRs, RFCs, design docs, etc.)
70 - Check recent session notes for decisions that might need an ADR
71 - If any recent decisions lack a corresponding ADR, note it:
72 "Decision from [date] about [topic] — should this be an ADR?"
73 - Briefly list available document types: "You can generate PRDs, RFCs,
74 ADRs, design docs, C4 diagrams, runbooks, post-mortems, and spike reports."
75
76Only surface documentation status if there's something actionable. Don't list
77document types every session — only on first session or if asked.
78
79## Step 7: Skill Inventory
80
8111. List available skills from `.claude/skills/` (names and one-line descriptions only).
82 Note any skills that were recently added or modified.
83
84## Step 8: Greet
85
8612. Greet the user briefly. If recent daily files contain relevant context (open items,
87 ongoing work), mention it. Keep it to 2-3 sentences max.
88
89Example: "Morning. Yesterday you were working on the event sourcing migration —
90left off at the projection rebuild. You also made a decision about caching strategy
91that might need an ADR. Ready to continue, or something new?"