Files
Dhravya Shah ed39afa764 feat: advertise search_memory when a project has no memories yet
The recall hook can only inject what it finds. On a miss it returned
silently, and silence reads to the model as "there is nothing to search"
— so it never reached for the tool, and history living in another
container stayed invisible for the whole session.

The guidance that would have fixed this already existed, but only inside
formatRecall(), which runs when recall already found something. It was
delivered in the case where it was least needed and withheld in the case
where it mattered most.

Emit a discovery block on the first genuinely-empty recall of a session:
name the tool, point at ToolSearch to resolve it (the tool ships under
three names depending on install shape, and deferred loading means the
model holds a bare name with no schema), interpolate the repo
containerTag, and note that read-only calls are auto-approved.

Gated to fire once per session, and only when the container is truly
empty rather than all-repeats — misses are the common case in an empty
project, so repeating it would tax every prompt and invite searches on
turns where memory is irrelevant. The marker is a file in the session
dir next to recalled.json; writeState would have meant widening the
EVENT_NAMES allowlist and touching the statusline renderer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011qEtmi9chBJMgirVCTpSLu
2026-09-12 15:52:59 -07:00
..