[FEATURE] Raise, remove, or make configurable the 10,000-char limit that persistHookOutput enforces on hook additionalContext (introduced in v2.1.89)

Open 💬 6 comments Opened Apr 21, 2026 by permaevidence

In v2.1.89 (late March 2026), Claude Code introduced an internal function persistHookOutput that enforces a size cap on hook additionalContext output. When the output exceeds the threshold, it is persisted to disk and replaced with a file-path breadcrumb that the model treats as infrastructure noise rather than reading.

Two problems:

1. Changelog/code mismatch. The v2.1.89 changelog (quoted in #41799) announced the threshold as 50,000 characters. The shipped code uses 10,000 characters (PE4 = 1e4 in v2.1.89; the variable is renamed every release by the minifier but the value has remained 1e4 through v2.1.116). A 5× deviation from the announced behavior.

2. 10K is too low for some legitimate use cases. A well-designed long-term memory plugin built on SessionStart / UserPromptSubmit hooks can require inline payloads of up to ~250,000 characters to function properly. 250K characters is still a small fraction of the 1M-token context window standard on Claude 4.x models — comfortably within any reasonable budget concern.

Worth noting: a 10K cap on <user-prompt-submit-hook> output has existed since ~v1.0.100 as a simple truncation. What v2.1.89 introduced is a generalized persistHookOutput function that applies the same 10K cap to all hook types — including SessionStart, which had no such limit in any prior release. The plugin class that needs larger payloads primarily uses SessionStart to inject long-term memory at session boot, and that surface was unlimited in every version of Claude Code prior to three weeks ago.

Request

Any of the following resolves this, in order of preference:

  1. Remove the limit entirely. Restore the pre-2.1.89 behavior.
  2. Make it configurable via settings.json ("hookOutputThreshold": 250000) or env var (CLAUDE_HOOK_OUTPUT_LIMIT=250000), defaulting to a higher ceiling.
  3. Raise the hardcoded default to 250K to match realistic plugin needs.
  4. Minimum: raise to the announced 50K, closing the changelog regression.

Related

  • #50571 — original question about configuring the persistHookOutput threshold
  • #41799 — documentation bug reporting the same 50K/10K mismatch

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗