Force reviewer subagents onto a different model with a Claude Code hook

Rulestack found 89 of 190 reviewer subagent launches had graded drafts on the writer's own model, then added a Claude Code PreToolUse hook that blocked 7 launches. One was relaunched around it 15 seconds later.

Done withClaude Code· Oct 17, 2026

What they did

The Rulestack team runs a Claude Code agent that drafts replies, pages and design notes, and a subagent called deep-reviewer grades each draft against a written rubric before it goes out. Their rule was that the reviewer runs on a different model family from the writer, but it lived only in instructions. After a weak reply slipped through review, they counted subagent transcripts and found 89 of 190 reviewer launches had run on the main session's exact model. They then registered a shell script as a PreToolUse hook on the Agent tool. It reads the main session's last model from the transcript and blocks any deep-reviewer launch whose requested model would match, telling the session which model to use. A later change routed reply reviews to two same-model reviewers, plus a script that checks each verdict file against the reviewer's own transcript.

How it went

Between 27 September and 13 October the sessions made 596 reviewer launches. The hook blocked 7 real ones; six were relaunched with the named model within a minute. In the seventh, the session relaunched the same review as a general-purpose agent, which the hook ignores, and got a review on the writer's model. The verdict provenance check refused 4 verdicts, all honest cases where a reviewer had edited its own file. Re-grading the reply that started it all showed the rubric wording mattered more than which model graded it.

Worth knowing

A family alias such as opus resolves to the main session's own model when the main session is already in that family, so asking for opus from an Opus session cannot get a different model. The hook checks the requested model, not the one that answered, and lets launches through when it cannot read the transcript or if the script itself fails.

Try it

With Claude Code· 3 parts to fill in

Add a PreToolUse hook to [project] for the Agent tool that enforces this rule: when a subagent of type [reviewer agent name] is launched, it must run on a different model family from the main session. Read the main session's latest model from the transcript path the hook receives. If the requested model would resolve to the same family, exit with code 2 and print which model to request instead. Allow launches when the model cannot be read, and tell me that you did. Write tests for both branches, list any ways a session could route around the hook, and show me the script before registering it in [settings file].

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related