Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions internal/hooks/claude/roborev-post-commit/hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Claude Code PostToolUse hook for roborev integration
# Triggers after git commit commands to remind the agent to check reviews

set -euo pipefail
INPUT=$(cat)

# Only trigger on git commit (match command field specifically, not full JSON)
echo "$INPUT" | jq -r '.tool_input.command // ""' | grep -q "git commit" || exit 0

# Check prerequisites
command -v roborev &>/dev/null || exit 0
git rev-parse --git-dir &>/dev/null || exit 0
roborev status &>/dev/null || exit 0

COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_SHORT=$(git rev-parse --short HEAD)

# stderr + exit 2 = Claude sees this message
echo "**ROBOREV** — Review queued for ${COMMIT_SHORT}. Run \`sleep 25 && roborev show ${COMMIT_SHA}\`, note job ID, then \`roborev address <id>\`." >&2
exit 2