Skip to main content

Module post_tool_use

Module post_tool_use 

Source
Expand description

spool hook post-tool-use — append a signal envelope to the distill queue.

The queue file is a JSONL-formatted append-only log under <cwd>/.spool/distill-pending.queue. Each line is one signal envelope; later phases (R3 starts consuming) read the queue at Stop to produce candidate memories.

§What gets recorded

  • recorded_at (unix seconds)
  • tool_name — the AI client passes this in via env or stdin
  • cwd — for cross-project sanity checks
  • payload — opaque string blob, currently the tool’s input/output summary truncated to 4 KiB to keep the queue bounded.

§R2 boundaries

  • We don’t yet redact secrets here; redact lives in R3 src/distill/redact.rs and runs at consume time. Storing raw payload is fine because .spool/ is project-local and we never send it anywhere in R2.
  • Queue trimming (LRU 100) is also R3 — R2 just appends.

Structs§

DistillSignalEnvelope
PostToolUseArgs

Functions§

run