Skip to main content
November 25, 2026

Don't Block the Agent: Let a Clean-Context Critic Decide

Don't Block the Agent: Let a Clean-Context Critic Decide

Long agent runs often stall on a small question, not a hard problem. "Should I check the replica or the app logs first?" The agent waits, the engineer is in another window, and nothing moves.

Letting the agent decide everything is how you get a restarted database nobody asked for. The middle path is to sort questions into lanes: some take the agent's own recommendation, some go to a second model with a clean context, and a few wait for a human. Below: how to build it with documented hooks, and why the critic is a guardrail, not an oracle.

Why Agent Questions Block

In Claude Code and the Agent SDK, a clarifying question is a tool call: per the user input docs, Claude calls AskUserQuestion, which triggers your canUseTool callback. Each call holds 1 to 4 questions with 2 to 4 options each. The blocking part is spelled out: "The callback can stay pending indefinitely. Execution remains paused until your callback returns."

Right for a chat, wrong for a three-hour refactor or a 03:00 alert investigation.

Look at the questions themselves. Matt Pocock's grilling skill, which makes an agent interview you about a plan, tells the model to "number each question and give your recommended answer" and to "Word each question so 'yes' accepts your recommended answer." When every question carries a recommendation, the human mostly says yes. A yes typed without reading protects nothing, and each one costs a wait.

Three Ways to Answer a Question

  1. Take the recommendation. The agent goes ahead with the option it marked as preferred, and logs the choice.
  2. Ask a clean-context critic. A second model gets only the question, the options and a short evidence packet, and picks an option or declines.
  3. Wait for a human. Where the harness allows, the question is parked so other work continues.

The routing is per lane, not per run. A lane is a class of decision: diagnostic ordering, a runbook edit, a production write. You flip one lane between automatic and manual without slowing the others.

Wiring It With Hooks

Claude Code hooks already have the pieces. A PreToolUse hook can match AskUserQuestion, and the docs describe how a hook answers it: return permissionDecision: "allow" "together with updatedInput that holds the answer, so the tool runs without prompting." Note the catch: "Returning "allow" alone is not sufficient for these tools." The answers field is a record keyed by the question text, and each value is the chosen option's label.

So a command hook can read the question, look up its lane, and either answer or step aside so the normal prompt appears:

# lanes.yaml: one entry per decision class
lanes:
  diagnostic-order:  auto      # take the recommended option
  time-window:       auto
  report-format:     auto
  hypothesis-choice: critic    # clean-context second model
  runbook-change:    critic
  prod-write:        human     # always ask
  customer-comms:    human
default: human                 # unknown lanes ask

When the hook answers, its output looks like this:

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "allow",
    "updatedInput": {
      "questions": [{ "question": "[diagnostic-order] App logs or replica lag first?", "header": "First check",
        "options": [{ "label": "App logs", "description": "Errors started at deploy time" },
                    { "label": "Replica lag", "description": "Read timeouts in traces" }],
        "multiSelect": false }],
      "answers": { "[diagnostic-order] App logs or replica lag first?": "App logs" }
    }
  }
}

Have the agent start each question with a lane tag such as [prod-write] (the header field allows only 12 characters). A question without a known tag falls to default: human.

For the critic, the hooks reference also documents type: "prompt" hooks, which "send a prompt to a Claude model for single-turn evaluation", and experimental type: "agent" hooks that can read files before they decide. Their default timeouts are 30 and 60 seconds. For a critic from another vendor, use a command hook that calls that model.

Keep Other Work Moving

A question that waits for a human should not stop the run. In Claude Code, "each subagent runs in its own context window" (subagent docs), and background subagents run while the main session keeps working. If a person may take longer to answer than your process can stay running, the user input docs suggest a PreToolUse hook that returns defer "instead of waiting in the callback". The hooks reference says defer works only in -p mode and only when Claude makes a single tool call in the turn; the turn then ends with stop_reason tool_deferred, so the process can exit and resume later instead of holding a callback open while a person decides.

One limit: "AskUserQuestion is not currently available in subagents spawned via the Agent tool." Fan-out workers cannot ask, so put the lane policy in their prompt: decide inside the lane, or report the open question to the parent.

Why a Clean Context Matters

The critic is useful because it has not read the transcript. The main agent has spent an hour building a theory, and its recommendation tends to fit it. A critic that sees only the question and the evidence has nothing to stay loyal to. Keep the packet small and factual:

  • the question and the options, word for word
  • the agent's recommended option, labelled as such
  • the evidence the agent cites for each option: log lines, metric values, the diff
  • what each option changes, and whether it can be undone
  • one instruction: pick an option, or answer ESCALATE if the evidence does not settle it

Use a different model for the critic if you can. In LLM Evaluators Recognize and Favor Their Own Generations, Panickssery, Bowman and Feng define self-preference as an evaluator scoring "its own outputs higher than others' while human annotators consider them of equal quality." They found "a linear correlation between self-recognition capability and the strength of self-preference bias." A same-family critic is more likely to nod along.

Guardrail, Not Oracle

Anthropic's Building effective agents describes the evaluator-optimizer pattern, where "one LLM call generates a response while another provides evaluation and feedback in a loop", and says it works best "when we have clear evaluation criteria." Most agent questions lack exactly that. The critic does not know your system better than the agent; it only lacks the agent's bias. Use its answer as a filter, not a verdict:

Critic result What happens
Agrees with the recommended option Proceed, log both answers
Picks a different option Do not override: escalate to a human, keep other lanes running
Answers ESCALATE Escalate to a human
Times out or returns invalid JSON Escalate to a human
Picks an option that is not in the list Treat as invalid, escalate to a human

Agreement between two models with different context is cheap evidence that the choice is sane. Disagreement shows where the evidence is thin, which is why you built the critic. A critic that can override the agent only moves the risky decision to a model that knows less.

Failure Modes to Watch

  • Lane creep. Someone flips prod-write to critic to unblock a demo and nobody flips it back. Keep the policy file in Git and review its changes like code.
  • One-sided packets. The agent writes the evidence, so it can stack it. Pass raw tool output where you can, not the agent's summary.
  • Compounding choices. Ten fine-looking automatic decisions can add up to a path nobody would pick. Log each one and review the log after the run.
  • Silent agreement. A critic that agrees 100% of the time is not checking anything. Seed a few questions where the recommended option is wrong and measure it, the same way we suggested for second-opinion models.

A Worked Incident Example

A 5xx alert fires on checkout. The agent hits four questions during the run:

  1. time-window: 30 minutes before the alert (recommended) or 2 hours. Auto.
  2. diagnostic-order: app logs (recommended) or replica lag. Auto.
  3. hypothesis-choice: the 14:02 deploy (recommended) or a noisy neighbour on the database host. The critic gets the error lines, the deploy time and the database CPU graph, and agrees.
  4. prod-write: roll back the deploy, or keep investigating. Human. The question waits while a background subagent keeps reading logs.

The engineer answers one question instead of four, and it is the one that changes production.

Doing This in Akmatori

Akmatori draws the same line at the tool boundary. SSH hosts on a connector are read-only by default, and the docs warn: "Every allowed pattern lets the agent run that command on every host of the connector without approval." The allowed-commands list is your automatic lane for writes, so keep it short. Runbook and skill updates drafted by the self-improvement evaluator arrive as proposals that an operator approves, rejects or refines in a review chat. That is a parked human lane. Lanes do not replace scoped tools: human approval alone is not a safety model.

Conclusion

Most agent questions need a recorded choice, not a person. Sort them into lanes, take the recommendation where a wrong answer is cheap, send real choices to a clean-context critic that can only agree or escalate, and keep production writes manual.

If your team wants AI-assisted incident workflows that keep investigations moving and leave the risky decisions to humans, Akmatori helps SRE teams investigate alerts, coordinate response, and automate safe infrastructure actions. Powered by Gcore for global infrastructure reliability.

Automate incident response and prevent on-call burnout with AI-driven agents!