Skip to content

feat(blocking-review): add cost guards and scope constraints - #17

Merged
twistedmelonman merged 2 commits into
mainfrom
claude/harden-review-cost-guards-20260320
Mar 21, 2026
Merged

feat(blocking-review): add cost guards and scope constraints#17
twistedmelonman merged 2 commits into
mainfrom
claude/harden-review-cost-guards-20260320

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

Summary

  • Add max_turns (default 6), timeout_minutes (default 4), and model inputs to claude-blocking-review.yml
  • Add input validation step with env vars to prevent expression injection
  • Add scope constraints to prompt (diff-only review, no codebase exploration)
  • Replace plugin-based example template with blocking review caller

Motivation

A Claude review on transmission-filebot PR #23 consumed 20 API turns, $1.00, and 11 minutes for a 109-line diff. The Anthropic code-review plugin has no turn limit or timeout, allowing unconstrained exploration.

Test plan

  • Merge this PR and update v1 tag
  • Open a test PR on transmission-filebot (after merging its migration PR) to verify review completes in <4 min with <=6 turns
  • Verify timeout_minutes and max_turns inputs work when overridden by callers
  • Verify input validation rejects invalid model names

🤖 Generated with Claude Code

Add max_turns (default 6), timeout_minutes (default 4), and model
inputs to prevent runaway API usage. A review on transmission-filebot
PR #23 consumed 20 turns, $1.00, and 11 minutes for a 109-line diff.

- Add --max-turns and --model to claude_args
- Add timeout-minutes to the Claude step
- Add input validation with env vars (prevents expression injection)
- Validate integer format before range checks
- Add scope constraints to prompt (diff-only, no codebase exploration)
- Replace plugin-based example template with blocking review caller

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/claude-code-review.yml Fixed
…ermissions on the example caller workflow.

  Add explicit permissions block matching what the called reusable
  workflow needs (contents:read, pull-requests:write, issues:write,
  id-token:write for claude-code-action OIDC auth).

  Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants