Skip to main content

Module stop

Module stop 

Source
Expand description

spool hook stop — drain pending signals + scan transcript for self-tags and incidents + persist via the shared distill pipeline, then attempt silent knowledge distillation.

§Pipeline

  1. Resolve transcript_path (priority: --transcript-path flag, --hook-input JSON transcript_path field, fallback scan of ~/.claude/projects/<sanitized-cwd>/).
  2. Delegate to crate::distill::pipeline::run which performs: queue drain → self-tag heuristic → extraction heuristic → redact + dedupe + LifecycleService writes (accepted + candidate).
  3. Attempt silent knowledge distillation: detect clusters of related fragments and auto-create candidate knowledge pages (actor: spool-auto-distill). Failures are logged to stderr and never propagate.
  4. Write <cwd>/.spool/last-stop.unix marker for debugging.

Stop hook is the automatic entry point for distill. The MCP memory_distill_pending tool exposes the same pipeline as a manual on-demand entry point (R4a).

Structs§

StopArgs
StopReport

Functions§

run