Skip to content

feat: SessionEnd(clear) catch-up so /clear keeps the last segment (0.26.0)#47

Merged
Shahinyanm merged 2 commits into
mainfrom
feat/session-end-clear-catchup
Jun 14, 2026
Merged

feat: SessionEnd(clear) catch-up so /clear keeps the last segment (0.26.0)#47
Shahinyanm merged 2 commits into
mainfrom
feat/session-end-clear-catchup

Conversation

@Shahinyanm

Copy link
Copy Markdown
Member

What

/clear discards the conversation and orphans the transcript, so the final segment's reasoning could be lost. Adds a SessionEnd hook that runs the same transcript catch-up as Stop when the session ends with reason clear — the last chance to capture before the transcript orphans.

  • New SessionEnd branch in ingest-hook: gated to reason == "clear", enqueues chunks newer than the active task's last event (label SessionEndChunk), spawns the classify-worker. Idempotent — gated to clear so it doesn't re-process what Stop already handled on other exits.
  • Wired into install-hooks --auto-capture (joins PostToolUse/Stop/PreCompact).
  • Gated by the same .capture-disabled kill-switch as the other capture hooks.

Closes claude-memory-mgc and the compaction-distiller epic's /clear gap.

This release also ships recall --json (#45, already merged to main) for the Loom host.

Tests

  • install_hooks_auto_capture_wires_all_events now asserts SessionEnd is wired.
  • session_end_hook_is_clean_noop_without_journal — clear/logout SessionEnd with no journal exits cleanly.
  • Full local gate green (fmt, clippy -D warnings, test --workspace).

🤖 Generated with Claude Code

Shahinyanm and others added 2 commits June 14, 2026 11:16
/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>
@Shahinyanm Shahinyanm merged commit af9bf78 into main Jun 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant