Claude Code: PreSkillShellCommand Hook Can Refuse Skill Shell Commands
Claude Code 2.1.332 adds a PreSkillShellCommand hook event that can refuse a skill's or command's inline shell commands as it loads. Hooks can now vet shell commands embedded in skills before they run. Settings files naming the event open a dialog at start on 2.1.331 and older.
Key Takeaways
PreSkillShellCommandis a new hook event for skill and command loading.- It can refuse inline shell commands in a skill or command as it loads.
- This adds a policy checkpoint for shell commands embedded in skills.
- On 2.1.331 and older, a settings file naming it opens a dialog at start.
- Teams with mixed versions should expect that dialog until all upgrade.
- A PreToolUse hook's reason for asking now shows on terminal Read, Grep, Glob, Edit and Write prompts.
A new hook event for skill shell commands
Claude Code 2.1.332 adds the PreSkillShellCommand hook event. It runs as a skill or command loads and can refuse the inline shell commands embedded in it. This gives teams a point at which to inspect and block shell commands that a skill would otherwise run automatically on load.
Compatibility note
On Claude Code 2.1.331 and older, a settings file that names PreSkillShellCommand opens a dialog at start, because the older version does not recognise the event. Mixed-version teams sharing settings should expect that dialog until everyone updates.
Related change
The release also fixes a PreToolUse hook's reason for asking not showing on terminal Read, Grep, Glob, Edit and Write permission prompts.