Repository navigation
Description
What happens
With recallCompress: "auto" on Claude Code, every UserPromptSubmit runs the local compressor (claude -p --model haiku) whenever the retrieved context is above recallCompressMinInputChars (default 1500), which in practice is every prompt. Retrieval itself takes about 0.1 s; compression takes 8–14 s (7 s even with --restricted, see #7644). So every prompt, including "yes", "proceed" or a one-line follow-up, waits that long before the model starts.
Measured on one machine (openviking-memory 0.7.23, macOS), from a Claude Code session transcript: about 150 prompts waited 10–20 s (median about 16 s) between submit and the API request; slash commands, which skip the hook, started in 0.1 s. Timing the hook directly: retrieval 0.1 s, recall_local_compression 8–14 s.
Why a prompt-length threshold
- Short prompts carry little query signal, so a compressed digest adds little over the raw recall block, and they are the replies where waiting is most noticeable.
- In the same transcripts, 51% of 2,634 typed prompts were 120 characters or less.
- The existing knobs don't cover it:
minQueryLength(max 64) skips recall entirely;recallCompressMinInputCharslooks at the retrieved text, not the prompt;recallCompress: "off"is global.
Request
- A setting such as
recallCompressMinPromptChars(default 0 = today's behaviour): when the user prompt is shorter, skip both local compression and the server rewrite, and inject the assembled context as is. - Measure the prompt after removing harness-injected blocks. In the Claude desktop app, the hook's
promptfield starts with<system-reminder>…</system-reminder>blocks (several hundred characters), so a raw length check never fires there. - Optionally, a prefix list (
recallCompressSkipPrefixes) for machine-sent prompts, such as a suggestion plugin's "The next-steps plugin sent a message:", which are long but gain little from a digest.
Local result
A local patch doing 1–3 in scripts/auto-recall.mjs (threshold 120 characters plus one prefix): short prompts 0.1–0.2 s instead of 8–14 s, with the raw block (about 1.4–1.6k tokens of the 3k budget) instead of the digest; long prompts unchanged.
Related
- [Feature]: Let the Claude Code memory plugin's local recall compressor skip user settings (--restricted), and log its stderr #7644 (lighter host compressor with
--restricted; this request complements it). - perf(codex): skip recall for control-only prompts #3881 (closed, unmerged) skipped recall entirely for control-only Codex prompts; this one keeps recall and skips only the compression, for any short prompt.
Environment
openviking-memory 0.7.23 (Claude Code plugin), Claude Code desktop app, macOS.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn progress
Activity
2SinceJuly commentedon Nov 19, 2026
Opened #8026 for items 1 and 2:
recallCompressMinPromptChars(default 0, off) skips both the local compressor and the server rewrite for short prompts, and the length is measured after stripping<system-reminder>blocks. Item 3 (recallCompressSkipPrefixes) is not included.