Repository navigation
v1.4.0 — Claude Code hooks: survive auto-compact
Added — Claude Code hooks: survive auto-compact
Anthropic moved Claude Code's auto-compact trigger for 1M-context models from ~97% of the window down to 40%, and compaction replaces the whole conversation with a summary — early-session detail is lost. DevOS memory lives on disk; v1.4 wires it into that lifecycle:
devos hooks installmerges two hook entries into./.claude/settings.json— aPreCompacthook and aSessionStarthook (matcherscompactandstartup). Existing settings and other hooks are preserved; re-running is idempotent.devos hookswith no argument prints the snippet for manual installation.devos hook precompactsaves a session snapshot — timestamp, trigger, session id, transcript path, git branch + uncommitted-file count — into the project's DevOS store (last 10 retained).devos hook sessionstartinjects a compact recall briefing asadditionalContext: the latest snapshot, the top project memories, and a one-line knowledge-graph summary, capped at ~110 lines / 6 KB. Prints nothing when there is nothing worth injecting.- Both hook entry points are fail-soft by contract: garbage or missing stdin is tolerated, errors are swallowed, exit code is always 0.
Honest limit: the snapshot is a briefing, not the full transcript.
Tests
New hooks.test.ts (9 tests). Totals: 186 pass / 0 fail / 25 todo across 211 tests (scanner 131/0/25, CLI 17, all other suites green).
Install: npx devos-os hooks install