Skip to content

Commit 9f2adeb

Browse files
committed
chore(claude): update claude PostToolUse hook to only format on write
1 parent c8d6cf0 commit 9f2adeb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.claude/hooks/post-edit.sh renamed to .claude/hooks/post-write-format.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
# Post-edit hook to format files after creating/editing
3+
# Post-write hook to format files after creating
44
# This is the bash equivalent of lint-staged in package.json
55

66
# To test this file directly via cli:
7-
# echo '{"tool_input": {"file_path": "path/to/your/file"}}' | .claude/hooks/post-edit.sh
7+
# echo '{"tool_input": {"file_path": "path/to/your/file"}}' | .claude/hooks/post-write-format.sh
88

99
# Read JSON from stdin and extract file path
1010
FILE=$(jq -r '.tool_input.file_path' 2>/dev/null)

.claude/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"hooks": {
33
"PostToolUse": [
44
{
5-
"matcher": "Edit|Write",
5+
"matcher": "Write",
66
"hooks": [
77
{
88
"type": "command",
9-
"command": ".claude/hooks/post-edit.sh"
9+
"command": ".claude/hooks/post-write-format.sh"
1010
}
1111
]
1212
}

0 commit comments

Comments
 (0)