Memory Phase 3 — SessionStart Inject Hook
Section titled “Memory Phase 3 — SessionStart Inject Hook”Closed the last deferred piece of KB-OS Memory v1: inject hardened from documented convention into an actual mechanism.
What shipped
Section titled “What shipped”~/ai-config/claude/hooks/session-start-inject.sh(SSOT; deploys to~/.claude/hooks/) — a Claude CodeSessionStarthook that silently injects a frozen-for-the-session snapshot:- Biggest Rocks table rows from
Core/DASHBOARD.md - Open (non-✅) bullet lines from
Core/_WorkingOn/Tasks/_active.md - Capped at 2000 chars, truncated at a line boundary, most-important-first
- Only fires on
source: startuporclear(skipsresume/compactas no-ops) - Recursion-guarded (
KB_SESSION_INJECTenv var) - Backgrounds a detached
qmd updateso recall is fresh from the first query — never blocks session start
- Biggest Rocks table rows from
- Registered as
SessionStartin~/ai-config/claude/settings.wsl.json, alongside the existingStop/Notification/SessionEndblocks.
Gap found and fixed along the way
Section titled “Gap found and fixed along the way”The task’s design assumed session-digest.sh was already “SSOT in ai-config, deploys via deploy.sh” — it wasn’t. It had been hand-placed directly in ~/.claude/hooks/, was untracked by git, and deploy.sh had no hooks-copying step at all. Fixed per the SSOT hard rule (migrate first, then point):
- Migrated
session-digest.shintoai-config/claude/hooks/(verified byte-identical viadiffbefore removing reliance on the old copy) - Added a
hooks/copy step todeploy.sh(WSL section)
Both hooks are now version-controlled and deploy correctly on every ai-config commit.
Verification
Section titled “Verification”- Fixture stdin tests:
source: startup→ valid JSON,additionalContextpopulated, contains Biggest Rocks + open tasks, capped at 1924/2000 chars (truncation triggered correctly, cut at a line boundary after the top-level Active section). source: resume/source: compact→ silent no-op, exit 0, no stdout.- Recursion guard (
KB_SESSION_INJECT=1) → silent no-op. bash -nsyntax check on both scripts.- Live smoke test against the deployed copy post-commit — same result as the fixture test.
- Not yet verified: the task’s own acceptance test (a genuinely fresh top-level session asking “what were we working on?” unprompted) — that can only be proven the next time Talbot starts a session, not from inside this one.
Commit
Section titled “Commit”ai-config 6f86d15 — feat(hooks): SessionStart inject hook — Memory Phase 3
Docs updated
Section titled “Docs updated”- KB-OS-Context §3 (Inject row: convention → mechanism) + §5 (moved from Active tasks → Shipped ✅)
STATUS.mdActive Work