PreMessageSend hook event silently removed in v2.1.96 — breaks existing configs without warning
Resolved 💬 1 comment Opened Apr 9, 2026 by inmtxx Closed Apr 10, 2026
Description
Claude Code v2.1.96 (auto-updated via VSCode extension on 2026-04-08) silently removed PreMessageSend as a valid hook event. Existing configurations using this event now produce:
Settings file failed to parse: /path/to/.claude/settings.json — Invalid key in record. Permission rules and other settings from this file are not in effect.
This means ALL permissions and hooks in that settings file stop working — not just the invalid hook.
Steps to Reproduce
- Have a working
settings.jsonwith aPreMessageSendhook (this worked in v2.1.92 and earlier):
{
"hooks": {
"PreMessageSend": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "/path/to/script.sh"
}
]
}
]
}
}
- Claude Code auto-updates to v2.1.96
- Restart VSCode
- Error banner appears — entire settings file is rejected
Expected Behavior
- Minimum: A deprecation warning in a prior version before removing the event
- Better: A clear migration message naming the replacement event (
UserPromptSubmit) - Best: Automatic migration of
PreMessageSend→UserPromptSubmitduring the update, similar to how other settings migrations are handled
Workaround
Replace PreMessageSend with UserPromptSubmit in your settings files. UserPromptSubmit fires before Claude processes the prompt, which is the closest equivalent.
Additional Context
- The auto-update also created a new
settings.jsonas part of a settings migration (file didn't exist before, was created at 08:37 after the extension updated at 08:24). The migration-generated file contained apermissionsblock that also triggered schema validation errors. PreMessageSendis not mentioned anywhere in the current hooks reference documentation — no deprecation notice, no mention in changelog.- The valid hook events as of v2.1.96 are:
SessionStart,InstructionsLoaded,UserPromptSubmit,PreToolUse,PermissionRequest,PostToolUse,PostToolUseFailure,Notification,SubagentStart,SubagentStop,Stop,PreCompact,SessionEnd.
Environment
- Claude Code: v2.1.96 (VSCode extension, auto-updated from v2.1.92)
- VSCode: Latest
- OS: macOS Tahoe 26.2 (Darwin 25.4.0, arm64)
- Previous working version: v2.1.92
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗