-
-
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I copied this for my local. Thank you for sharing!