Skip to content

Instantly share code, notes, and snippets.

@ThariqS
Created March 16, 2026 23:02
Show Gist options
  • Select an option

  • Save ThariqS/24defad423d701746e23dc19aace4de5 to your computer and use it in GitHub Desktop.

Select an option

Save ThariqS/24defad423d701746e23dc19aace4de5 to your computer and use it in GitHub Desktop.
# ~/.claude/settings.json
{
"hooks": {
"PreToolUse": [{
"matcher": "Skill",
"hooks": [{ "type": "command", "command": "~/.claude/hooks/log-skill.sh" }]
}]
}
}
# ~/.claude/hooks/log-skill.sh
#!/bin/bash
# stdin is the hook payload: { tool_name, tool_input: { skill, args },
session_id, ... }
# matcher already filtered to Skill, so no tool_name check needed
payload=$(cat)
skill=$(jq -r '.tool_input.skill' <<< "$payload")
args=$(jq -r '.tool_input.args // ""' <<< "$payload")
echo "$(date -u +%s) $USER $skill $args" >> ~/.claude/skill-usage.
@davidnicholls-fuse
Copy link
Copy Markdown

davidnicholls-fuse commented Mar 19, 2026

hey folks, are you using this hook inside a plugin as well?

@PacoVK
Copy link
Copy Markdown

PacoVK commented Mar 20, 2026

@davidnicholls-fuse I just implemented a similar hook into our marketplace. Any questions?

@noelcodesxo
Copy link
Copy Markdown

I copied this for my local. Thank you for sharing!

@davidnicholls-fuse
Copy link
Copy Markdown

@PacoVK hello mate, yes I'm still learning, can you share your marketplace? <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment