Claude Code 2.1.299 to 2.1.301 Changed How Your Hooks Behave: 7 Things to Recheck
Book: Prompt Engineering Pocket Guide Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub Since Claude Code 2.1.299, a UserPromptSubmit hook runs before your skill expands, so a hook that blocks the prompt…
Claude Code version 2.1.299 through 2.1.301 introduced several changes to how hooks behave. These updates can affect existing hooks and require rechecking certain aspects of your setup. Here are seven key points to consider:
1. UserPromptSubmit hooks now run before skill expansion. Previously, a blocking hook would stop the prompt but not the skill's shell commands. This change means hooks may now see the prompt before any embedded shell commands are executed. To check for affected hooks, look for patterns in UserPromptSubmit hooks that only match skill expanded text and adjust accordingly.
2. Skills now have their own UserPromptSubmit hook that runs after the initial prompt. If your skill's UserPromptSubmit hook relied on the initial prompt, it will now start with the next prompt. Skills with UserPromptSubmit hooks that check the invoking prompt should be moved to UserPromptExpansion in settings.
3. The updatedInput field in hooks is now validated, and unknown keys are dropped. This change applies to PreToolUse and PermissionRequest hooks. Hooks that return only changed fields or incorrectly spelled fields may cause input rejections. To test this, use a script to generate an input object and verify the updatedInput output.
4. In Cowork cloud sessions, setMode updates in PermissionRequest hooks are now ignored. The rest of the approval still applies, but the mode setting will not be changed. This change does not affect local installations but is important for users working with Cowork.
5. No other changes were mentioned in the source material, so these seven points cover the major updates to hooks in Claude Code versions 2.1.299 to 2.1.301. Users should review their hooks and make necessary adjustments to ensure compatibility with the new version.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.