VS Code extension: SessionStart plugin hook additionalContext logged as succeeded but never injected into model context

Status Open
Reported on v2.1.236
Maintainer reply None cached
Activity 0 comments · opened Aug 19, 2026

Environment

  • Claude Code VS Code extension version: 2.1.236 (darwin-arm64)
  • Entrypoint: claude-vscode
  • macOS (Darwin 25.5.0)

Summary

A plugin-provided SessionStart hook executes successfully and produces correct additionalContext, but that context is never actually delivered into the model's conversation context when the session is run through the VS Code extension. The same hook, run through the terminal CLI (claude -p, both fresh and --resume) with the identical --setting-sources=user,project,local flags the extension uses, works correctly.

Repro

  1. Install/enable a plugin with a hooks/hooks.json registering a SessionStart hook, e.g.:

``json
{
"hooks": {
"SessionStart": [
{ "hooks": [ { "type": "command", "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/inject_pipeline.py\"", "timeout": 10 } ] }
]
}
}
`
where the script prints:
`json
{"hookSpecificOutput": {"hookEventName": "SessionStart"}, "additionalContext": "<some markdown>"}
``

  1. Enable the plugin in ~/.claude/settings.json (enabledPlugins).
  2. Start a new session inside the VS Code extension (panel/sidebar mode, claudeCode.preferredLocation set).
  3. Ask Claude, in the very first turn, whether it received the injected additionalContext.

Expected

The hook's additionalContext is delivered to the model as a <system-reminder> (or equivalent) before/with the first turn, same as it is when running the plain CLI interactively.

Actual

The hook runs and is recorded as successful. In the session's own JSONL transcript (~/.claude/projects/<project>/<sessionId>.jsonl), the very first entry is a hook_success attachment containing the correct stdout (with the full additionalContext payload):

{"parentUuid":null,...,"attachment":{"type":"hook_success","hookName":"SessionStart:startup",...,"stdout":"{\"hookSpecificOutput\": {\"hookEventName\": \"SessionStart\"}, \"additionalContext\": \"...\"}\n","stderr":"","exitCode":0,"command":"python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/inject_pipeline.py\"","durationMs":172},...}

But the model itself never receives this content — no <system-reminder> with the pipeline text appears anywhere in its context, and the immediate next entry in the transcript is the raw first user message with nothing prepended. Confirmed by directly asking the model in-session what it received: it reported no such context.

Running the identical hook config through the terminal CLI (claude -p "..." --setting-sources=user,project,local, and again with --resume=<id>) shows the same Hook SessionStart:startup (SessionStart) success debug line and correct payload — the difference appears specific to how the VS Code extension (claude-vscode entrypoint) wires hook output into the model-facing context, versus just logging it for the transcript/UI.

Impact

Any plugin relying on SessionStart (or likely other hook events with additionalContext) to inject context into the model's turn silently fails to do so for every session started inside the VS Code extension, with no error surfaced to the user — the hook shows as succeeded in logs, giving no indication anything is wrong.

View original on GitHub ↗