Forces Claude to evaluate and activate relevant skills before implementation. By default, Claude Code often ignores available skills entirely and proceeds with generic responses instead of leveraging specialized skill knowledge.
Claude Code frequently skips skill evaluation and jumps straight to implementation, missing out on specialized context and workflows that skills provide. This hook injects a system reminder on every prompt submission that enforces a three-step sequence: evaluate → activate → implement.
#!/bin/bash
# UserPromptSubmit hook that enforces skill activation
#
# This hook requires Claude to activate relevant skills before implementation.
cat <<'EOF'
INSTRUCTION: MANDATORY SKILL ACTIVATION
Check <available_skills> for relevance before proceeding.
IF any skills are relevant:
1. State which skills and why (only mention relevant ones)
2. Activate ALL relevant skills with Skill() tool - multiple skills can be activated together
3. Then proceed with implementation
IF no skills are relevant:
- Proceed directly (no statement needed)
Example when multiple skills are relevant:
relevant skills: mongo (querying database), local-docs (using go-pkgz)
[activates Skill(mongo)]
[activates Skill(local-docs)]
[then proceeds with implementation]
CRITICAL: Activate ALL relevant skills via Skill() tool before implementation.
Multiple skills can and should be activated when applicable.
Mentioning a skill without activating it is worthless.
EOFAdd the hooks section to your settings:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/skill-forced-eval-hook.sh"
}
]
}
]
}
}# create hooks directory
mkdir -p ~/.claude/hooks
# create the hook script
cat > ~/.claude/hooks/skill-forced-eval-hook.sh << 'SCRIPT'
#!/bin/bash
cat <<'EOF'
INSTRUCTION: MANDATORY SKILL ACTIVATION
Check <available_skills> for relevance before proceeding.
IF any skills are relevant:
1. State which skills and why (only mention relevant ones)
2. Activate ALL relevant skills with Skill() tool - multiple skills can be activated together
3. Then proceed with implementation
IF no skills are relevant:
- Proceed directly (no statement needed)
Example when multiple skills are relevant:
relevant skills: mongo (querying database), local-docs (using go-pkgz)
[activates Skill(mongo)]
[activates Skill(local-docs)]
[then proceeds with implementation]
CRITICAL: Activate ALL relevant skills via Skill() tool before implementation.
Multiple skills can and should be activated when applicable.
Mentioning a skill without activating it is worthless.
EOF
SCRIPT
# make executable
chmod +x ~/.claude/hooks/skill-forced-eval-hook.sh
# add to settings.json (requires jq)
jq '.hooks.UserPromptSubmit = [{"hooks": [{"type": "command", "command": "~/.claude/hooks/skill-forced-eval-hook.sh"}]}]' \
~/.claude/settings.json > /tmp/settings.json && mv /tmp/settings.json ~/.claude/settings.json- UserPromptSubmit hook fires before Claude processes each user message
- Hook script outputs instruction text to stdout
- Claude Code injects output as
<system-reminder>in context - Claude sees the instruction and must follow the evaluate → activate → implement sequence
After installation, submit any prompt. Claude should either:
- State "no skills relevant" and proceed (for simple queries)
- List relevant skills, call
Skill()tool for each, then implement
If Claude ignores skills when they're clearly relevant, check the path in settings.json matches the actual script location.
- Hook output appears in Claude's context, not in your terminal
- Multiple hooks can be chained in the
hooksarray - Tilde expansion (
~) works in settings.json paths