]> git.ipfire.org Git - thirdparty/systemd.git/commit
claude-review: improve review quality for large PRs
authorDaan De Meyer <daan@amutable.com>
Fri, 10 Apr 2026 08:04:08 +0000 (08:04 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 10 Apr 2026 08:57:35 +0000 (10:57 +0200)
commita65ebc3ff9a868bd447faa59789ee8e9ad8c534a
tree7e13da6399e65f171ffe354b913cf0d567664087
parentfb0ae7436dbd7182ec2d53cca366599f9031db4d
claude-review: improve review quality for large PRs

Several issues were identified from analyzing logs of a large (52-commit) PR
review:

- Claude was batching multiple commits into a single review agent instead of
  one per worktree. Strengthen the prompt to explicitly prohibit grouping.
- Claude was reading pr-context.json and commit messages before spawning
  agents despite instructions not to, wasting time. Tighten the pre-spawn
  rules to only allow listing worktrees/ and reading review-schema.json.
- Subagents were spawned with model "sonnet" instead of "opus". Add explicit
  instruction to use opus.
- After agents returned, Claude spent 9 minutes re-verifying findings with
  bash/grep/sed commands, duplicating the agents' work. Add instruction to
  trust subagent findings and only read pr-context.json in phase 2.
- Subagents returned markdown-wrapped JSON instead of raw JSON arrays. Add
  instruction requiring raw JSON output only.
- Each subagent was independently reading review-schema.json. Instead have
  the main agent read it once and paste it into each subagent prompt.
- The "drop low-confidence findings" instruction was being used to justify
  dropping findings that Claude itself acknowledged as valid ("solid cleanup
  suggestions", "reasonable consistency improvement"). Remove the instruction.
- Simplify the deduplication instructions
- Stop adding the severity to the body in the post processing job as claude is
  also adding it so they end up duplicated.
.github/workflows/claude-review.yml