hookSpecificOutput.additionalContext not injected into system prompt (Windows)

Status Fixed / completed
Reported on v2.1.177
Maintainer reply None cached
Activity 3 comments · opened Jun 21, 2026 · closed Jun 21, 2026

Bug Description

Plugin hooks that return hookSpecificOutput.additionalContext are executed successfully, but the content is NOT injected into the system prompt sent to the model.

Environment

  • Claude Code version: 2.1.177
  • Platform: Windows 11 (Git Bash)
  • Shell: /bin/bash.exe

Steps to Reproduce

  1. Install the superpowers plugin (which has a SessionStart hook)
  2. Start Claude Code with claude --debug hooks
  3. The hook executes successfully and returns additionalContext (5632 chars)
  4. Test injection: Modify the hook to add a unique marker (e.g., TESTMARKER_12345_67890) to the additionalContext content
  5. Start a new Claude Code session
  6. Ask the model: "Does your system prompt contain TESTMARKER_12345_67890?"
  7. Model responds: "No, I don't see that marker"

Expected Behavior

The additionalContext from the hook should be injected into the system prompt, and the model should be able to see it.

Actual Behavior

  • Debug log shows: Hook SessionStart provided additionalContext (5632 chars)
  • But the model cannot see the injected content
  • No log entry confirms injection into the system prompt

Evidence

Debug log (b37dc0c7-d6fa-4fe6-8475-e956666f41f8.txt):

2026-06-21T08:58:16.347Z [DEBUG] Hook SessionStart:startup (SessionStart) success:
{
  "hookSpecificOutput": {
    "hookEventName": "SessionStart",
    "additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers..."
  }
}
2026-06-21T08:58:16.348Z [DEBUG] Hook SessionStart provided additionalContext (5632 chars)

But when asked, the model reports no knowledge of the injected content.

Additional Context

This is a bug in the injection mechanism itself, not related to the model. The TESTMARKER test proves that additionalContext is not being added to the system prompt at all, regardless of which model is being used.

View original on GitHub ↗

3 Comments

hhhhhhh520 · 3 months ago

Update: Root Cause Identified - Not a Claude Code Bug

After thorough investigation, I've identified the root cause and confirmed this is not a Claude Code bug.

Key Finding

The hook execution is identical for both model configurations:

  • Both hooks return (6106 chars) successfully
  • Both are logged as by Claude Code
  • The hook content is exactly the same in both cases

The Difference

| Config | Model | Superpowers |
|--------|-------|-------------|
| ark-code-latest | | ✅ Works |
| mimo | | ❌ Doesn't work |

The only difference is the API endpoint and model name. Claude Code's configuration (settings.json, hooks, plugins) is identical.

Root Cause

The issue is with the mimo proxy (), not Claude Code. The proxy either:

  1. Strips the field from the system prompt
  2. Doesn't support the Anthropic API format for additionalContext
  3. Modifies the request in a way that loses the injected content

Evidence

  • Direct curl test to mimo API confirms the proxy can pass system prompts correctly
  • But Claude Code's full request format (with additionalContext) may be handled differently by the proxy
  • ark-code-latest (using a different proxy) works correctly

Conclusion

This is a third-party proxy compatibility issue, not a Claude Code bug. Closing this issue.

hhhhhhh520 · 3 months ago

Update: Root Cause Identified - Not a Claude Code Bug

After thorough investigation, I've identified the root cause and confirmed this is not a Claude Code bug.

Key Finding

The hook execution is identical for both model configurations:

  • Both hooks return additionalContext (6106 chars) successfully
  • Both are logged as provided additionalContext by Claude Code
  • The hook content is exactly the same in both cases

The Difference

| Config | Model | Superpowers |
|--------|-------|-------------|
| ark-code-latest | ark-code-latest | Works |
| mimo | mimo-v2.5-pro[1m] | Does not work |

The only difference is the API endpoint and model name. Claude Code configuration (settings.json, hooks, plugins) is identical.

Root Cause

The issue is with the mimo proxy (token-plan-cn.xiaomimimo.com/anthropic), not Claude Code. The proxy either:

  1. Strips the additionalContext field from the system prompt
  2. Does not support the Anthropic API format for additionalContext
  3. Modifies the request in a way that loses the injected content

Evidence

  • Direct curl test to mimo API confirms the proxy can pass system prompts correctly
  • But Claude Code full request format (with additionalContext) may be handled differently by the proxy
  • ark-code-latest (using a different proxy) works correctly

Conclusion

This is a third-party proxy compatibility issue, not a Claude Code bug. Closing this issue.

github-actions[bot] · 1 month ago

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.