Skip to content

[BUG] Hook output over 10K silently dropped from context with zero signal — memory plugins lose injected data invisibly #84021

Description

@Alex-Fleet

Problem
Hooks that emit more than 10,000 characters of additionalContext (internal persistHookOutput threshold, since v2.1.89) are persisted to a temp file and never injected into the model context. The hook receives no error, no warning, and no way to know its output was discarded.

Why this is worse than just a size cap
For long-term-memory plugins this is silent data loss on every session start:

  • Hook writes ~38KB of context → process exits 0 → nothing in context → the model starts with no memory.
  • No stderr warning, no marker in the hook JSON output, no log line — a plugin author cannot detect this from the hook side.
  • The user sees a normal-looking session and has no idea the injected context was dropped.

Requested
When output exceeds the threshold, give the hook (and the user) an explicit signal:

  1. A warning line on stderr and/or in the hook result, and/or
  2. A structured field in the hook JSON (e.g. additionalContextFile + truncated: true), and/or
  3. A persistent log entry.

That at least turns invisible loss into an observable condition that plugins can handle (chunk their own output, fail loudly, or surface it to the user).

Related

Environment: Claude Code 2.1.216, VS Code extension, macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions