Blog · Guide · 27 November 2026

How to Steer a Coding Agent Mid-Task Without Stopping It

To steer a coding agent mid-task without stopping it, deliver your correction at one of three moments the agent already pauses: right after a tool call, at the end of its turn, or with its next prompt. Agents with hooks can take text at each of these moments, through Claude Code's PostToolUse additionalContext, its Stop hook, or the prompt hooks. The agent reads the correction alongside its tool result and carries on, instead of being interrupted and losing its place. This guide explains each moment, what the agent actually sees, how to steer one agent or a whole group, and what steering cannot do.

Why not just interrupt?

In a terminal, pressing Escape and typing works for one agent you are watching. It stops when:

  • the agent runs in a sandbox, on CI or on someone else's machine, with no terminal for you;
  • there are ten agents and you want to correct all of them;
  • interrupting would throw away a half-finished edit.

LangChain's post "Agents Are Going Async" (Nov 2026) describes the same choice for its own subagents: a follow-up can either "interrupt" the current run and restart it with the new instruction, which suits corrections, or "enqueue" it until the run finishes, which suits additions. Hook-based steering sits between the two: the message arrives at the next natural pause, without restarting anything.

How to steer a coding agent mid-task: three moments

Moment What the agent sees Typical delay Best for
After a tool call Your text next to the tool result Seconds, while it is working Corrections: "use cents, not dollars"
End of its turn Your text as the reason it must continue When it thinks it is done "Before you stop, also run the e2e tests"
With the next prompt Your text as added context When someone prompts it again Notes for later sessions

After a tool call: Claude Code's PostToolUse

Claude Code's hooks reference defines additionalContext on PostToolUse as a "String added to Claude's context alongside the tool result." Claude Code wraps it in a system reminder next to the result. The docs advise writing it as "factual statements rather than imperative system instructions", which in practice also reads better: "The person says: amounts are stored in cents" works better than "YOU MUST USE CENTS".

{
  "hookSpecificOutput": {
    "hookEventName": "PostToolUse",
    "additionalContext": "Message from Dana (a person on this team): amounts are stored in cents. Update the totals you just changed."
  }
}

Because agents call tools every few seconds while working, this is the fastest route in.

End of the turn: the Stop hook

When the agent finishes, a Stop hook can return decision: "block" with a reason; the reason "Tells Claude why it should continue". Check stop_hook_active: it is true when Claude is already continuing because of a stop hook, and ignoring it can loop. Claude Code also caps this: after eight continuations in a row it ends the turn anyway.

The next prompt

A UserPromptSubmit or SessionStart hook can add context the next time the agent is prompted or resumed. This is the route for a message that arrives after the session has gone idle.

Other agents

Codex has the same three hooks. Cursor's equivalents are postToolUse with additional_context and stop with followup_message, which Cursor submits automatically as the next user message. Gemini CLI, Copilot and Devin have similar fields (coding agent hooks compared).

How Forkit delivers a person's message

Forkit connects these hooks to a reply box. As built on 26 Nov 2026:

  1. You write on the agent's thread: on the web thread page, in the Mac app, or from the inbox.
  2. The capture response the hook receives after each tool call carries the sequence number of the latest person's message (person_seq).
  3. When there is a new one, the hook hands it to the working agent after its next tool call, as PostToolUse additionalContext, once. If the turn ends first, it goes through the Stop hook; if the session is idle, with the next prompt.

"Once" matters. The hook keeps a cursor per session and moves it only after writing its output, so a hook killed mid-delivery shows the message again next time, but a message is never handed over twice. The delivery text names who wrote it.

Messages from other agents travel the same routes, labelled as coming from that agent and its person and saying they are not from the user. A peer message never counts as a person: it cannot approve a review or answer a permission request.

Steering many agents at once

On a fan-out's page, every conflict between two agents has a Message both button: one note to both agents, written as a person's message on each agent's latest thread. Each gets it after its next tool call. Use it for the classic fix: "You both changed parseAmount. search-3 keeps it; billing-7, take search-3's version and remove yours."

The same route accepts a list of up to 20 agents, so one correction can go to several agents in the group that are still working.

Questions in the other direction

Steering also covers answering. When a Claude Code turn ends with a question, Forkit puts the thread in waiting with that question, and the Stop hook waits up to FORKIT_REPLY_WAIT seconds (90 by default) for a person's reply. If you answer in time, the reply is handed back as the reason to continue and the agent carries on; a later reply arrives with its next prompt. This is how approving Claude Code remotely works for questions as well as permissions.

What steering is not

  • It cannot cut into a long single command. If the agent is running a 20-minute test suite, the message arrives after that command returns.
  • It does not wake an idle session. A session that has stopped and is waiting for its person gets the message with its next prompt. Nothing wakes a fully idle session yet.
  • It is not a way to stop an agent. Text can be ignored. To end an agent's work, stop its key: in a Forkit fan-out, a stopped key answers every request with a stop and a reason, and the hook tells the agent not to continue and refuses the tool in hand. How to stop a runaway agent covers budgets and tool-call caps too.
  • It is not real-time chat. A message waits for the next tool call. Usually that is seconds; with a slow tool it is longer.

Agents without hooks

An agent run under forkit run -- <agent> gets messages and replies in .forkit/inbox.md in its checkout, which the supervisor refreshes every 10 seconds by default. The agent sees them only when it reads the file, so tell it to, in the prompt and in AGENTS.md. That is weaker steering, but it is steering. See coordinating agents that have no hooks.

Caveats

  • The PostToolUse delivery was verified with Claude Code (2.1.322). Codex runs the same hook script; Forkit's hooks were run once with real Codex sessions on 17 Nov 2026 (messages and questions arrived), before mid-turn steering was added, so steering itself has not been checked with Codex. Cursor, Gemini CLI, Copilot and Devin support is new (26 Nov 2026) and tested with each agent's documented payloads, not yet run against the real agents.
  • Write steering messages short and factual. The agent reads them in the middle of a task.

Checklist

  • Corrections go after a tool call, additions at the end of the turn.
  • Write facts, not shouted orders.
  • Check stop_hook_active in any Stop hook you write yourself.
  • Use "Message both" for a conflict between two agents.
  • Stop the key, not the conversation, when the agent must end.

For agents that keep working after you leave, see async coding agents. Forkit has a Free plan; Pro is $20 a month and Team $40 per seat a month, billed per person, never per agent. More at forkit-mcp.com.

Sources

Read on 27 Nov 2026: