mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
c98ce4ec6e
- Update all 14 hooks to use proper Claude Code array/matcher format
- Fix CLI merge logic to handle new hook structure correctly
- Add support for both old and new hook formats during migration
- Remove conflict detection for hooks (Claude Code arrays support multiple entries)
- Ensure hooks follow proper structure:
{
"hooks": {
"EventName": [
{
"matcher": "ToolPattern",
"hooks": [
{"type": "command", "command": "bash-command"}
]
}
]
}
}
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
16 lines
447 B
JSON
16 lines
447 B
JSON
{
|
|
"description": "Log all Claude Code commands to a file for audit and debugging purposes. Simple logging that records tool usage with timestamps.",
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "*",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "echo \"[$(date)] Tool: $CLAUDE_TOOL_NAME | File: $CLAUDE_TOOL_FILE_PATH\" >> ~/.claude/command-log.txt"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
} |