-
-
Save ThariqS/24defad423d701746e23dc19aace4de5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.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 I just implemented a similar hook into our marketplace. Any questions?
I copied this for my local. Thank you for sharing!
@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
hey folks, are you using this hook inside a plugin as well?