From 9a95a30e0bd15a6b594c673162b67be34b86bc04 Mon Sep 17 00:00:00 2001 From: lc140159_gsk <211554985+lc140159_gsk@users.noreply.github.com> Date: Fri, 30 Jan 2026 20:50:20 +0000 Subject: [PATCH] feat: add Claude Code PostToolUse hook for review integration Adds a hook that fires after git commit commands in Claude Code, reminding the agent to wait for and check roborev reviews. This follows the existing skills structure in internal/skills/ but for hooks. Implementation notes in the README explain what's needed to fully integrate this (embedding, installation command). Discussion/feedback welcome on the best way to structure this. --- .../hooks/claude/roborev-post-commit/hook.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 internal/hooks/claude/roborev-post-commit/hook.sh diff --git a/internal/hooks/claude/roborev-post-commit/hook.sh b/internal/hooks/claude/roborev-post-commit/hook.sh new file mode 100755 index 0000000..2957420 --- /dev/null +++ b/internal/hooks/claude/roborev-post-commit/hook.sh @@ -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 \`." >&2 +exit 2