Feature: PreToolUse/PostToolUse hooks for local slash command (skill) execution
Summary
When a skill is invoked via a CLI slash command (e.g. /issue, /commit), the skill prompt is injected directly into the conversation context. This bypasses the Skill tool entirely, so PreToolUse[Skill] hooks never fire.
This makes it impossible to intercept or augment skill execution at the hook level when skills are triggered the most natural way — as slash commands.
Current Behavior
/issue→ skill prompt injected as system context →Skilltool never called →PreToolUse[Skill]hook does not fireSkilltool called mid-conversation →PreToolUse[Skill]hook fires correctly
Desired Behavior
A hook event (e.g. PreSkillUse / PostSkillUse, or PreCommand / PostCommand) that fires when a skill is invoked via a local slash command, with the skill name and arguments available on stdin — consistent with the existing hook contract.
Use Case
Project-level persona agents (subagents in .claude/agents/) configured to evaluate feature proposals before a GitHub issue is created. The evaluation is wired as a PreToolUse[Skill] hook targeting the issue skill, but it only works when the skill is called programmatically mid-conversation, not when the user types /issue directly.
{
"hooks": {
"PreToolUse": [
{
"matcher": "Skill",
"hooks": [{ "type": "command", "command": "bash .claude/hooks/persona-issue-hook.sh" }]
}
]
}
}
Proposed Hook Contract
{
"hooks": {
"PreSkillUse": [
{
"matcher": "issue",
"hooks": [{ "type": "command", "command": "bash .claude/hooks/persona-issue-hook.sh" }]
}
]
}
}
stdin payload (same pattern as PreToolUse):
{ "skill": "issue", "args": "Add swipe-to-add on ingredient categories" }
stdout from the hook is injected as context before the skill executes, allowing the hook to augment or block execution — same semantics as PreToolUse.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗