Retrieval
Recall is where the two surfaces differ most. On Claude Code it’s genuinely automatic; on Claude.ai it’s driven by Claude following the Relay skill. Both run the same server-side filtering.
When recall fires
This is the real difference between the surfaces — and it’s worth understanding precisely:
team_memory_search and injects results as context before Claude answers. It fires on (a) the first substantive prompt of a session and (b) a topic shift — not on every message, and it’s throttled so it won’t re-fire within a couple of prompts on the same topic.Same team_memory_search tool and the same filtering underneath — only the trigger differs.
Automatic recall on Claude Code, precisely
The Relay installer wires a UserPromptSubmit hook into Claude Code. It runs before Claude processes each of your prompts, and decides whether to search team memory using three rules — so recall is frequent enough to be useful without firing on every message:
- 1Session start. The first substantive prompt of a session always searches, so context is loaded up front.
- 2Topic shift. On later prompts it searches only when the topic changes — measured by keyword overlap with the last search dropping below
0.30. Staying on the same topic doesn’t re-search. - 3Throttled. Even on a topic shift it won’t re-fire within 2 prompts of the previous search, and it skips very short prompts (under 15 characters). It’s also hard-capped at ~4s so it never delays your prompt.
Net effect: in a typical session the hook searches a handful of times — at the start and whenever you move to a new topic — not on every turn. Results are injected as context, so Claude answers already knowing what the team remembers.
Manual recall (asking Claude to “check team memory”) still works at any time and is exactly the same underneath — same team_memory_search tool, same filtering. The only difference is what triggers it: the hook (automatic) vs you asking (manual).
Tune the automatic recall yourself
The hook is a plain shell script you own — tweak it to make recall more or less eager. It lives at ~/.relay/relay-autosearch-hook.sh and is registered as a UserPromptSubmit hook in ~/.claude/settings.json. Edit the knobs near the top of the script:
THROTTLE_PROMPTS = 2
Minimum prompts between auto-searches on a similar topic. Raise it to search less often; lower it (e.g. 1) to search more eagerly.
OVERLAP_THRESHOLD = 0.30
A search fires on a topic shift when keyword overlap with the last search drops below this. Higher = more sensitive to topic changes (fires more); lower = only on big shifts.
MIN_PROMPT_LEN = 15
Prompts shorter than this are skipped (avoids searching on “ok”, “yes”, etc.). Raise to ignore more short prompts.
CURL_TIMEOUT = 4
Hard cap (seconds) on the search request so the hook never delays your prompt. Rarely needs changing.
THROTTLE_PROMPTS=2 # min prompts between searches on a similar topic OVERLAP_THRESHOLD=0.30 # fire on topic shift when keyword overlap < this MIN_PROMPT_LEN=15 # skip prompts shorter than this CURL_TIMEOUT=4 # hard cap (seconds) on the search request
UserPromptSubmit array in ~/.claude/settings.json (or delete the script). Re-running the Relay install script restores the defaults.The server-side pipeline (both surfaces)
However recall is triggered, every result passes the same server-side checks before it reaches Claude:
- 1Tenant isolation. Any result not stamped with your exact organization id is dropped before anything is returned. One org can never read another’s memory.
- 2Role scoping. A memory only surfaces for the audiences it was written for. A commercial teammate won’t see dev-only memories, and vice-versa.
- 3Expiry check. Memories past their valid_until date are filtered out, so retrieval reflects what’s true now.
- 4Relevance ranking. What’s left is scored by semantic similarity — meaning, not keywords — and only the top few most-relevant memories are returned.
Because it’s semantic, a constraint written once (“we don’t use that library because…”) surfaces months later when someone asks something related, phrased completely differently — and on Claude Code, before the mistake, not in a wiki nobody opens.