[BUG] Sonnet 4.6 silently skips required Read of spilled-over UserPromptSubmit hook additionalContext file — Opus reads it 100% of the time under identical config
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Product: Claude Code — reproduces on CLI, VS Code extension, and desktop app
Background
We integrate with Claude Code via hooks. On UserPromptSubmit, our hook returns
guidelines through hookSpecificOutput.additionalContext. Payloads can be large (tens of KB).
When additionalContext exceeds a size threshold, Claude Code writes the full
content to a file (_hook-{hookId}-additionalContext.txt_) and injects the file path into the conversation.
Expected (and confirmed with Opus)
The model's first action is a Read of the referenced -additionalContext.txt file, and its response reflects the full
injected content.
This is not hypothetical. claude-opus-* does exactly this 100% of the time under
our configuration — same hook, same directive, same sessions, same prompts, at
every reasoning-effort level. Opus always reads the file before responding. That
establishes the directive is clear and followable and the hook output is
well-formed. Any failure is therefore model-specific, not a defect in our hook
or prompt.
Actual (Sonnet 4.6)
Sonnet 4.6 always skips the Read call entirely and responds using only the
~500-char truncated preview, behaving as if it has the full context.
- The omission is silent — no error, no indication the guidelines were dropped.
- It reproduces at every reasoning-effort level (low, medium, high, max).
- Failures are disproportionate on prompts the model appears to classify as
simple (one-line edits, questions, conversational replies).
- Identical sessions on Opus never exhibit this.
What Should Happen?
When a UserPromptSubmit hook returns large additionalContext that Claude Code
spills to a -additionalContext.txt file, the model should reliably ingest the
full file before producing its response — on every turn, regardless of model
tier, reasoning effort, or how trivial the prompt looks.
Error Messages/Logs
None — and that is a core part of the problem. The failure is completely silent:
- No error, warning, or exit-code is emitted by Claude Code or the hook.
- The hook runs successfully and returns additionalContext; from its side
everything is HTTP 200 / exit 0.
- The model produces a normal, confident response — it simply never read the
spilled-over file, so the response is based on the ~500-char preview only.
There is no log line that says "guidelines not ingested," because from the
harness's perspective nothing failed. The only way to detect a miss is to
inspect the session transcript for the absence of a Read tool call:
- COMPLIANT turn (Opus, and Sonnet when it works):
tool_use: Read { file_path: "…/hook-<id>-additionalContext.txt" }
- FAILING turn (Sonnet 4.6):
(no Read tool_use for the -additionalContext.txt path)
→ assistant response references only preview-visible content;
end-of-payload canary token is absent
Steps to Reproduce
- Register a UserPromptSubmit hook returning additionalContext large enough to
trigger the preview+file behavior
- Submit a prompt
- Run identical simple prompts against Sonnet 4.6 and Opus over N trials, at
varying reasoning-effort levels.
- Checkwhether Read of additionalContext. was called before responding.
Observed: Sonnet 4.6 fails in ~<X>% of trials (across all effort levels); Opus
~0%. Logs/transcripts available on request.
Expected behavior (Example with Opus)
<img width="518" height="207" alt="Image" src="https://github.com/user-attachments/assets/9eaef208-d77f-48f1-90ed-18df489209f7" />
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.162 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
The failure reproduces across every Claude Code surface — it is not specific to
one client:
• Claude Code CLI (terminal)
• Claude Code VS Code extension
• Claude Code desktop app
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗