A UserPromptSubmit hook that nudges Claude to log session work before context compaction wipes it out.
Claude Code instructions like "proactively log your work" in CLAUDE.md are unreliable. Claude gets absorbed in the task and skips logging. When context compaction hits, the session's work history is lost.
A PreCompact hook can't solve this either: by the time compaction triggers, the context window is nearly full. Claude wouldn't have room to reason about what happened and write a meaningful log entry.