Skip to content

Instantly share code, notes, and snippets.

@jleechan2015
Created April 4, 2026 08:20
Show Gist options
  • Select an option

  • Save jleechan2015/dceba43cfe25efbb126babe6a44422f0 to your computer and use it in GitHub Desktop.

Select an option

Save jleechan2015/dceba43cfe25efbb126babe6a44422f0 to your computer and use it in GitHub Desktop.
churn-guard.sh repro steps — PR #373

churn-guard.sh — Reproduction Steps

Setup

git clone https://github.com/jleechanorg/agent-orchestrator.git
cd agent-orchestrator
git checkout feat/churn-guard

Test 1: Non-PR commands pass through

echo '{"tool_name":"Bash","tool_input":{"command":"echo hello"}}' | bash .claude/hooks/churn-guard.sh
echo "Exit: $?"  # Expected: 0

Test 2: Non-Bash tools pass through

echo '{"tool_name":"Write","tool_input":{"file_path":"/tmp/test.txt","content":"hello"}}' | bash .claude/hooks/churn-guard.sh
echo "Exit: $?"  # Expected: 0

Test 3: PR create with no file overlap passes

echo '{"tool_name":"Bash","tool_input":{"command":"gh pr create --title test --body test --repo jleechanorg/agent-orchestrator"}}' | bash .claude/hooks/churn-guard.sh
echo "Exit: $?"  # Expected: 0 (no overlap with open PRs)

Test 4: Syntax validation

bash -n .claude/hooks/churn-guard.sh
echo "Exit: $?"  # Expected: 0

Test 5: REST API PR creation pattern detected

echo '{"tool_name":"Bash","tool_input":{"command":"gh api repos/jleechanorg/agent-orchestrator/pulls --method POST -f title=test"}}' | bash .claude/hooks/churn-guard.sh
echo "Exit: $?"  # Expected: 0 (detected as PR create, checked for overlap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment