SessionStart hook output saved to disk at ~10K instead of documented 50K threshold

Resolved 💬 2 comments Opened Apr 2, 2026 by jasonmoo Closed May 25, 2026

Description

SessionStart hook output is persisted to disk at roughly 10KB instead of the 50K threshold documented in the v2.1.89 changelog:

Changed hook output over 50K characters to be saved to disk with a file path + preview instead of being injected directly into context

Still reproduces on v2.1.110 (also seen on v2.1.92, v2.1.96).

Minimal Repro

  1. Add a SessionStart hook that emits ~30KB of stdout — well under the documented 50K cutoff:

``json
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "yes 'filler line' | head -c 30000"
}
]
}
]
}
}
``

  1. Start a new session: claude.
  2. Ask Claude what the SessionStart hook produced, or check verbose mode (Ctrl+O).

Expected

30KB is injected inline as context, per the v2.1.89 changelog threshold of 50K.

Actual

Output is written to disk and only a ~2KB preview is injected:

Output too large (29.3KB). Full output saved to: /home/user/.claude/projects/.../tool-results/hook-xxxxx-stdout.txt

Preview (first 2KB):
...

Bisecting by output size, the persistence cutoff kicks in somewhere near 10K, not 50K. Anything above that loses the tail of the payload from the injected context.

Impact

SessionStart is the documented mechanism for injecting onboarding / project context. A realistic orientation payload (project summary, package list, conventions) trivially exceeds 10K, at which point most of it is dropped from context and replaced with a 2KB preview. The only workaround is splitting content across multiple hooks or aggressively truncating at the hook level (e.g. --max-output-length 10000), which defeats the purpose of the documented 50K budget.

Not duplicates of the bot-flagged issues

  • #17944 (closed) — about BASH_MAX_OUTPUT_LENGTH being ignored for the Bash tool. Related symptom (early disk persistence) but a different code path and a different env var. This issue is specifically about SessionStart hook output, which has its own documented 50K threshold per the v2.1.89 changelog.
  • #41799 (open) — a docs-only request to document the 50K preview behavior in the hooks reference. Different ask: that issue wants the docs updated; this issue reports that the runtime behavior doesn't match the (changelog-)documented threshold.

Environment

  • Claude Code CLI v2.1.110 (also v2.1.92, v2.1.96)
  • Linux

View original on GitHub ↗

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