-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
SessionEnd hooks skipped on /clear and /compact — learnings lost #1043
Copy link
Copy link
Open
Description
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.jsonlso 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels