feat: SessionEnd(clear) catch-up so /clear keeps the last segment (0.26.0)#47
Merged
Conversation
/clear discards the conversation and orphans the transcript, so the final segment can be lost. Add a SessionEnd handler (wired by install-hooks --auto-capture) that runs the same transcript catch-up as Stop when reason==clear — the last chance to capture before the transcript orphans. Gated to clear so it doesn't re-process what Stop already handled on other exits. Also bundles the recall --json release (#45, for the Loom host). claude-memory-mgc Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rflow) The inline SessionEnd block pushed main()'s already-huge stack frame past Windows' 1MiB main-thread stack — the binary crashed at startup (STATUS_STACK_OVERFLOW, code -1073741571) on EVERY command, failing all Windows CI. Move the logic into run_session_end_catchup() so its locals get their own frame and main's shrinks back under the limit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/cleardiscards the conversation and orphans the transcript, so the final segment's reasoning could be lost. Adds aSessionEndhook that runs the same transcript catch-up asStopwhen the session ends with reasonclear— the last chance to capture before the transcript orphans.SessionEndbranch iningest-hook: gated toreason == "clear", enqueues chunks newer than the active task's last event (labelSessionEndChunk), spawns the classify-worker. Idempotent — gated toclearso it doesn't re-process whatStopalready handled on other exits.install-hooks --auto-capture(joins PostToolUse/Stop/PreCompact)..capture-disabledkill-switch as the other capture hooks.Closes claude-memory-mgc and the compaction-distiller epic's
/cleargap.This release also ships
recall --json(#45, already merged to main) for the Loom host.Tests
install_hooks_auto_capture_wires_all_eventsnow assertsSessionEndis wired.session_end_hook_is_clean_noop_without_journal— clear/logout SessionEnd with no journal exits cleanly.fmt,clippy -D warnings,test --workspace).🤖 Generated with Claude Code