[BUG] PostToolUse hook additionalContext (memo_reminder.sh) not reaching Claude in VSCode extension

Status Open
Reported on v2.1.210
Maintainer reply None cached
Activity 2 comments · opened Jul 21, 2026

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?

Environment:
Claude Code VSCode extension (native), macOS

Steps to reproduce:

Register a PostToolUse hook in ~/.claude/settings.json with matcher Bash, running a script that detects git commit in the command and returns {"additionalContext": "..."}
Have Claude run a Bash tool call containing git commit
Check whether the additionalContext reminder appears in the conversation

What Should Happen?

Expected behavior:
After the Bash tool call matches git commit, the hook's additionalContext should be surfaced to Claude in the conversation (this is the documented purpose of additionalContext for PostToolUse hooks).

What happened (actual behavior):
Across 5 real git commit tool calls in one session, the additionalContext reminder never appeared in the conversation. The hook script itself is confirmed correct — running it manually with a synthetic payload (echo '{"tool_name":"Bash","tool_input":{"command":"git commit -m test"}}' | bash memo_reminder.sh) produces the correct JSON output. A separate PostToolUse hook (matcher *) that logs each tool call's tool_response also shows no additionalContext field present for those same commit calls.

This suggests additionalContext from a matcher-scoped PostToolUse hook isn't being delivered back to Claude in this VSCode extension environment, even though the hook configuration and script logic are both correct.

Error Messages/Logs

Error Messages/Logs:
No error is thrown — the failure is silent (nothing appears where the reminder should). There's no stack trace to attach. Relevant evidence instead:

Hook config (~/.claude/settings.json):


"PostToolUse": [
  {
    "matcher": "Bash",
    "hooks": [
      { "type": "command", "command": "bash \"$HOME/.claude/hooks/memo_reminder.sh\"" }
    ]
  }
]
Manual test of the hook script (confirms it works standalone):


$ echo '{"tool_name":"Bash","tool_input":{"command":"git commit -m test"}}' | bash memo_reminder.sh
{
  "additionalContext": "リマインド: 今のcommitに対応するAICodeMemoエントリを書いたか確認すること(CLAUDE.md「AICodeMemo」セクション参照)。"
}
Across 5 real git commit Bash tool calls in one session, no additionalContext ever appeared in the conversation. A separate logging hook (matcher *) records each tool call's full tool_response payload — checked those 5 entries directly, none contain an additionalContext field either.

Steps to Reproduce

Steps to Reproduce:

Register a PostToolUse hook in ~/.claude/settings.json with matcher Bash that returns {"additionalContext": "..."} when the Bash command contains git commit
In a Claude Code session (VSCode extension), have Claude run a Bash tool call containing git commit
Observe whether the additionalContext text appears anywhere in Claude's subsequent context/conversation

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.210

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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