[Bug] Hook additionalContext injected multiple times in context pipeline
Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Dec 17, 2025 · closed Jan 13, 2026
Bug Description
Bug Report: Hook additionalContext Duplicated in Context Injection
Summary
Hook additionalContext output is injected into Claude's context multiple times. This occurs regardless of plugin configuration and affects both SessionStart and UserPromptSubmit hooks.
Behavior
- Within-block duplication: A single hook's additionalContext is concatenated with itself, appearing twice within one system-reminder
- Cross-block duplication: Some hook outputs appear in multiple separate system-reminder blocks
Impact
- Wasted context tokens from duplicate content
- Multiple "hook succeeded" messages displayed at startup
- Potential for duplicate side effects
Not the Cause
- Explicit "hooks" field in plugin.json (tested with plugins that don't have it)
- Multiple plugin versions in cache (cleaned, still duplicates)
- Disabled plugins (verified only enabled plugins affected)
Related
Issue #10871 documents duplicate hook registration from explicit hooks field. This is different - the output injection pipeline is duplicating content even when hooks are registered correctly.
Environment
- Claude Code: v2.0.71
- macOS Darwin 24.6.0
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.0.71
- Feedback ID: ce26c52b-b25e-46ed-b93c-55b57a2169a9
Errors
[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/kyle/.local/share/claude/versions/2.0.71 (expected in multi-process scenarios)\n at hXR (/$bunfs/root/claude:2415:2165)\n at JKA (/$bunfs/root/claude:2415:1885)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-17T04:31:06.032Z"}]
5 Comments
Are you sure it's just the context being added twice? I'm seeing something very similar, except the command itself is being invoked twice (and so all the outputs are as well). The debug logs from
claude --debugshow something about policy settings triggering a reload, but I suspect the ones from the initial load aren't cleaned up, so everything is loaded twiceI'm not _super_ sure @iso2013 but I think so. You can ask Claude what it sees within its own context window, and it will respond with
I can see xyz twiceetc.Likely related to or same root cause as #10871 (Plugin-registered hooks executed twice with different PIDs). Both involve duplicate hook execution in the plugin system.
I believe this has been fixed in v2.1
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.