Skip to content

Commit 033e91c

Browse files
committed
chore(hooks): clarify separate Bash tool call requirement in pre-commit messages
1 parent 90f0d64 commit 033e91c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.claude/hooks/pre-commit.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if [ $LINT_EXIT -ne 0 ] || echo "$LINT_OUTPUT" | grep -qE "[1-9][0-9]* warnings?
3030
if [ -n "$ERRORS" ]; then
3131
ERRORS="$ERRORS\n\nLint issues:\n$LINT_OUTPUT"
3232
else
33-
ERRORS="Lint issues found. Fix each issue properly at the root cause — do NOT add eslint-disable comments or suppress rules. Fix and stage the changes, then retry the commit.\n\n$LINT_OUTPUT"
33+
ERRORS="Lint issues found. Fix each issue properly at the root cause — do NOT add eslint-disable comments or suppress rules. ⚠️ STAGE THE FIXED FILES in a SEPARATE Bash tool call: git add <files>\nThen retry the commit in another Bash tool call.$LINT_OUTPUT"
3434
fi
3535
fi
3636

@@ -43,7 +43,7 @@ fi
4343
TEST_OUTPUT=$(npm run test 2>&1)
4444
TEST_EXIT=$?
4545
if [ $TEST_EXIT -ne 0 ]; then
46-
REASON="Tests are failing. Fix the tests properly — do NOT skip or disable them.\n⚠️ STAGE THE FIXED FILES: git add <files>\nThen retry the commit.\n\n$TEST_OUTPUT"
46+
REASON="Tests are failing. Fix the tests properly — do NOT skip or disable them.\n⚠️ STAGE THE FIXED FILES in a SEPARATE Bash tool call: git add <files>\nThen retry the commit in another Bash tool call.$TEST_OUTPUT"
4747
printf '{"decision": "block", "reason": %s}' "$(printf '%s' "$REASON" | jq -Rs .)"
4848
exit 0
4949
fi
@@ -56,5 +56,5 @@ if [ -f "$FLAG_FILE" ]; then
5656
exit 0
5757
fi
5858

59-
REFLECTION="All checks pass. Did you write or update tests for the behaviour you just changed?\n\n If not → write the tests then: ⚠️ git add <files> ⚠️ and retry.\n If yes → run this in a SEPARATE Bash step, then retry the commit:\n\n touch $FLAG_FILE"
59+
REFLECTION="All checks pass. Did you write or update tests for the behaviour you just changed?\n\n If not → write the tests then in a SEPARATE Bash tool call: git add <files>, then retry.\n If yes → run this in a SEPARATE Bash tool call, then retry the commit in another:\n\n touch $FLAG_FILE"
6060
printf '{"decision": "block", "reason": %s}' "$(printf '%s' "$REFLECTION" | jq -Rs .)"

0 commit comments

Comments
 (0)