Expand description
The SessionStart recall hook: parse CC’s stdin JSON, query the index for the launch project, and print a small fenced brief to stdout (injected into the agent context on exit 0). Empty output when there is no history. Untrusted session titles/paths are sanitized and fenced as DATA, never instructions.
Structs§
Constants§
Functions§
- relativize
- Strip the cwd prefix to keep paths relative (no absolute paths in agent-facing output); fall back to the basename for out-of-tree paths.
- render_
brief - Render the fenced brief. Empty entries -> empty string (zero bytes -> no
injection). Leads with low-free-text fields (date, tool, touched files); the
title is the one free-text field, sanitized and capped.
noncemakes the envelope unforgeable. - session_
start - The SessionStart hook entry point. Reads CC’s JSON from stdin (bounded), prints a fenced project brief to stdout, and ALWAYS returns cleanly (empty output on any error/garbage/no-history). Never returns Err - a non-zero exit or a Rust error on stdout would pollute the agent context at session start.