Problem
/clear and /compact destroy conversation context but don't trigger SessionEnd. This means:
- WorkCompletionLearning never fires — work state, ISC progress, and session insights are lost
- RelationshipMemory never fires — interaction patterns from the session aren't captured
- Session progress isn't snapshotted — if the user continues in the same session, there's no record of what came before
/compact fires PostCompact, but that hook only re-injects state — it doesn't save anything.
Impact
Users who frequently use /clear (to start fresh mid-session) or /compact (to manage context) lose all the learning/relationship data that SessionEnd would have captured. The more actively someone manages their context, the more data they lose.
Proposed fix
A UserPromptSubmit hook that detects /clear and /compact in the prompt text and runs a lightweight harvest before the command executes:
- Work completion learning — same as
WorkCompletionLearning: capture work state, ISC progress
- Relationship notes — same as
RelationshipMemory: extract W/B/O notes from transcript
- Progress snapshot — annotate active progress files with a context-reset marker
- Rating signal flush — mark the reset point in
ratings.jsonl so analysis knows context changed
The hook does NOT run cleanup (tab reset, state deletion) since the session continues after both commands.
Fast exit (<5ms) for all non-matching prompts — zero overhead on normal usage.
Problem
/clearand/compactdestroy conversation context but don't triggerSessionEnd. This means:/compactfiresPostCompact, but that hook only re-injects state — it doesn't save anything.Impact
Users who frequently use
/clear(to start fresh mid-session) or/compact(to manage context) lose all the learning/relationship data thatSessionEndwould have captured. The more actively someone manages their context, the more data they lose.Proposed fix
A
UserPromptSubmithook that detects/clearand/compactin the prompt text and runs a lightweight harvest before the command executes:WorkCompletionLearning: capture work state, ISC progressRelationshipMemory: extract W/B/O notes from transcriptratings.jsonlso analysis knows context changedThe hook does NOT run cleanup (tab reset, state deletion) since the session continues after both commands.
Fast exit (<5ms) for all non-matching prompts — zero overhead on normal usage.