Build This Now
Build This Now
Keyboard ShortcutsStatus Line Guide
speedy_devvkoen_salo
Blog/Toolkit/Hooks/Skill Activation Hook

Skill Activation Hook

A UserPromptSubmit hook that scans each message, matches keywords, and appends skill activation hints so Claude Code never forgets to load the right skill.

Stop configuring. Start building.

SaaS builder templates with AI orchestration.

Published Feb 21, 2026Toolkit hubHooks index

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 responding

Claude 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:

  1. You type a message - Your natural language request
  2. Hook intercepts - Before Claude sees anything
  3. Pattern matching - Hook checks skill-rules.json for keyword and intent matches
  4. Append recommendations - Matching skills get added to your message
  5. 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.mjs

Suggestions 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

  1. Check your skill-rules.json matches your vocabulary
  2. Add keywords for new skills you create
  3. Set up the main Hooks Guide for complete hook coverage
  4. Configure the Stop Hook to enforce task completion
  5. Learn more about CLAUDE.md configuration to complement the hook
  6. 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.

Continue in Hooks

  • Claude Code Setup Hooks
    Braid scripts, agents, and docs into Claude Code setup hooks. One command runs a deterministic script, hands output to a diagnosing agent, logs living docs.
  • Context Backup Hooks for Claude Code
    A StatusLine-driven Claude Code context backup hook. Writes structured snapshots every 10K tokens so auto-compaction never eats errors, signatures, decisions.
  • Cross-Platform Hooks for Claude Code
    Cross-platform Claude Code hooks: skip .cmd, .sh, and .ps1 wrappers and invoke node directly so one .mjs file runs on macOS, Linux, and Windows across the team.
  • Hooks Guide
    Claude Code hooks from first principles: exit codes, JSON output, async commands, HTTP endpoints, PreToolUse and PostToolUse matchers, production patterns.
  • MCP Tool Hooks in Claude Code
    How to call MCP server tools directly from Claude Code hooks using type: mcp_tool — schema, substitution syntax, use cases, and production patterns.
  • Claude Code Permission Hook
    Install a three-tier Claude Code permission hook: instant allow for safe calls, instant deny for dangerous ones, LLM check for the gray area. No skip flag.

More from Toolkit

  • Keyboard Shortcuts
    Configure Claude Code keybindings.json: 17 contexts, keystroke syntax, chord sequences, modifier combinations, and how to unbind any default shortcut instantly.
  • Status Line Guide
    Set up a Claude Code status line for model name, git branch, session cost, and context usage. settings.json config, JSON input, bash, Python, Node.js scripts.
  • AI SEO and GEO Optimization
    A rundown of Generative Engine Optimization: how to get content cited inside ChatGPT, Claude, and Perplexity responses instead of just ranked on Google.
  • Claude Code vs Bolt.new: Which Should You Use?
    Bolt.new prototypes in 28 minutes with zero setup. Claude Code takes 90 minutes but ships production-ready code. Here is how to pick the right tool.

Stop configuring. Start building.

SaaS builder templates with AI orchestration.

On this page

How It Works
The Matching System
Configuration: skill-rules.json
Customization for Your Speech Patterns
Session Intelligence
Setup in ClaudeFast
Common Issues
Next Actions

Stop configuring. Start building.

SaaS builder templates with AI orchestration.