Skip to content

[Feature]: Claude Code memory plugin: skip local recall compression for short prompts (prompt-length threshold) #7654

Open

Description

@Johnzhu5

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; recallCompressMinInputChars looks at the retrieved text, not the prompt; recallCompress: "off" is global.

Request

  1. 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.
  2. Measure the prompt after removing harness-injected blocks. In the Claude desktop app, the hook's prompt field starts with <system-reminder>…</system-reminder> blocks (several hundred characters), so a raw length check never fires there.
  3. 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

Environment

openviking-memory 0.7.23 (Claude Code plugin), Claude Code desktop app, macOS.

Activity

  1. moved this from Backlog to In progress in OpenViking projecton Nov 19, 2026
  2. 2SinceJuly commented on Nov 19, 2026

    @2SinceJuly

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions