Skill Activation Hook
A hook on UserPromptSubmit that appends matching skill recommendations to every prompt before Claude reads it.
Problem: A skill you asked Claude Code to use never gets loaded. You move the rule into CLAUDE.md. Same outcome. You end up retyping the reminder by hand for skills the framework was supposed to pick up on its own.
Quick Win: A hook can intercept every prompt and tack the right skill recommendations on the back. Forgetting goes away because Claude was never asked to remember.
Send the message "help me implement a feature" and what actually lands in Claude's input is this:
help me implement a feature
SKILL ACTIVATION CHECK
CRITICAL SKILLS (REQUIRED):
-> session-management
RECOMMENDED SKILLS:
-> git-commits
ACTION: Use Skill tool BEFORE respondingClaude sees the exact skills it should pull in, right next to your request. Nothing to guess. Nothing to remember.
How It Works
UserPromptSubmit is the event the hook latches onto. Anything you submit goes through this flow:
- You type a message - Your natural language request
- Hook intercepts - Before Claude sees anything
- Pattern matching - Hook checks
skill-rules.jsonfor keyword and intent matches - Append recommendations - Matching skills get added to your message
- Claude receives both - Your prompt plus skill guidance
The whole thing finishes in milliseconds. No delay you'd actually feel.
The Matching System
Two strategies run in parallel.
Keyword Matching is a literal string check. Mention "commit" or "git push" and the git-commits skill fires.
Intent Patterns lean on regex for the way real people phrase things. The pattern (implement|build).*?feature picks up both "let's implement this feature" and "build a new feature for me".
Configuration: skill-rules.json
Triggers for every skill live in .claude/skills/skill-rules.json:
{
"skills": {
"session-management": {
"enforcement": "suggest",
"priority": "critical",
"promptTriggers": {
"keywords": ["feature", "implement", "build", "refactor"],
"intentPatterns": ["(implement|build).*?feature"]
}
},
"git-commits": {
"enforcement": "suggest",
"priority": "high",
"promptTriggers": {
"keywords": ["commit", "git push", "commit changes"],
"intentPatterns": ["(create|make).*?commit"]
}
}
}
}Suggestions get grouped by priority:
- Critical - Must load before any work
- High - Strongly recommended
- Medium - Helpful context
- Low - Optional enhancement
Customization for Your Speech Patterns
The hook bends to your vocabulary. If "push my code" is what comes out of your fingers instead of "git push", drop it in:
"keywords": ["commit", "git push", "push my code", "commit changes"]Whenever you build a new skill, edit its triggers in skill-rules.json. Then look at what you put in there and let those phrases guide how you write prompts.
Session Intelligence
The hook remembers what it already suggested. If session-management came up earlier in the same conversation, it stays quiet the second time around. Same coverage, less noise.
State is kept in recommendation-log.json and clears itself after 7 days.
Setup in ClaudeFast
The hook ships pre-configured. Open .claude/settings.local.json and confirm one of these two blocks is in there:
Windows:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c \".claude\\hooks\\SkillActivationHook\\skill-activation-prompt.cmd\""
}
]
}
]
}
}Linux/Mac:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/SkillActivationHook/skill-activation-prompt.sh"
}
]
}
]
}
}Common Issues
No suggestions appearing - Your keywords probably don't match how you actually talk. Run the hook by hand and watch the output:
echo '{"session_id":"test","prompt":"implement a feature"}' | node .claude/hooks/SkillActivationHook/skill-activation-prompt.mjsSuggestions appearing when not needed - Keywords are too broad. Tighten them, or move the trigger into an intent pattern.
Duplicate suggestions - The hook is wired up in two places at once. Pick one settings file and remove it from the other.
Next Actions
- Check your
skill-rules.jsonmatches your vocabulary - Add keywords for new skills you create
- Set up the main Hooks Guide for complete hook coverage
- Configure the Stop Hook to enforce task completion
- Learn more about CLAUDE.md configuration to complement the hook
- Review the skills guide if you need to create new skills
The Skill Activation Hook takes human memory out of the loop. Describe the work in plain language. Picking the right skills falls to the framework. That is the whole point of having one.
Stop configuring. Start building.
Context Backup Hooks for Claude Code
A StatusLine-driven backup system that writes structured snapshots every 10K tokens so auto-compaction cannot eat your session detail.
Claude Code Permission Hook
Three-tier permission delegation for Claude Code: instant approve, instant deny, and an LLM check for the gray area.