Early access: your personal sandbox is free, with $5 in model credits included. AQ adds no markup on your model usage. Start free

aq.dev / guides / steer-coding-agents-mid-run

How to Steer a Coding Agent Mid-Run: Queue, Interrupt, Rewind

Steering a coding agent mid-run means correcting a session that is still working, without killing it and losing its context. Every major agent CLI now ships some version of three levers: queue a message the agent picks up at its next boundary, interrupt the current step and redirect, and rewind to an earlier checkpoint. This guide covers the exact mechanics in Claude Code, Codex CLI, and Cursor's cloud agents as of August 2026, the signals that a run needs intervention, and how to redirect cleanly.

Why mid-run steering is the cheapest intervention you have

Most agent-quality guidance covers the two ends of a run: a better prompt before, diff review after. The middle is where the money is. An agent that pivoted away from your intent at minute three will happily spend twenty more minutes building the wrong thing, and by review time the abandoned plan is several hundred lines to read, reject, and re-run. Catching the pivot live costs one sentence. And drift is not rare: long runs compact their own context so early constraints silently fall out, debugging detours become the new main quest, and a plan goes stale the moment the agent discovers the codebase disagrees with it, and none of it shows up as an error. With several agents going at once, monitoring the fleet tells you which session needs eyes; this page is what to do in the thirty seconds after you look.

The three levers, and what each one costs

Escalate in that order: queue fixes most drift, interrupt when the agent is doing damage, rewind when the wrong path has contaminated code or conversation.

What each CLI actually gives you (as of August 2026)

Claude Code. Typing a message and pressing Enter while Claude works queues it rather than interrupting: it is delivered as soon as the current tool calls finish, within the same turn. Esc is the interrupt: it stops the current response or tool call mid-turn, keeps the work done so far, and sends anything you had queued right away. Double Esc on an empty prompt opens the rewind menu, backed by checkpoints captured before each prompt you sent: restore code, conversation, or both. Two documented limits matter: rewind only tracks edits made through Claude's own file tools (files changed by shell commands such as rm or mv are not restored), and checkpoints are session-level recovery, not a git replacement.

Codex CLI. OpenAI shipped steer mode in January 2026 and it is now stable and on by default: pressing Enter while the agent is working sends your message mid-turn, delivered at the next step boundary, and the agent adapts without losing its progress. Tab queues the message for after the current turn completes instead. Esc interrupts the active task while keeping the session, and /fork branches the conversation to try a different approach without abandoning the original.

Cursor cloud agents. Cursor's cloud agents accept follow-up messages while running, delivered at the agent's next tool call rather than cutting it off mid-action. Notably, Cursor documents that teammates on the same Cursor team can send follow-ups to a cloud agent another person started, provided they can view the agent and have access to its repository.

AgentQueue a correctionInterruptRewind
Claude CodeEnter while running (delivered when current tool calls finish)Esc, keeps work done so farDouble Esc: restore code, conversation, or both
Codex CLITab queues for after the turn; Enter steers mid-turn by defaultEsc/fork branches the session
Cursor cloud agentsFollow-up delivered at the next tool call; teammates can send them tooStop from the dashboardRe-run from the dashboard

The signals that a run has drifted

You cannot steer what you do not notice. The reliable signals are visible in the live transcript:

A short playbook for the redirect itself

How you phrase the correction decides whether the agent recovers:

Steering also starts before the run: plan-first modes (the agent proposes an approach you approve before it edits) and executable specs give the run a contract to steer against, turning "this feels wrong" into "step three violates the plan you approved."

Steering is still a single-player sport

The structural problem: on almost every surface, the only person who can see a drifting run, and the only person who can correct it, is the person whose terminal it is. A July 2026 LeadDev analysis of 25,264 agent-generated pull requests across 2,361 popular GitHub repositories found that in 79 percent of agentic PRs the same developer both reviewed and modified the agent's contribution, and only about one in eight workflows involved multiple humans. The same pattern holds one stage earlier, mid-run, where the fix is cheapest: your teammate may know the subsystem the agent is mangling far better than you do, but if the session lives in your local terminal, their knowledge cannot reach it. The DIY answer is a shared box (agents in tmux on a server, teammates attach over SSH), but SSH-for-everyone is a blunt permission model, and nothing tells a teammate which of five sessions needs eyes.

Where AQ fits

AQ is the multiplayer coding harness where engineering teams run AI coding agents like Claude Code and Codex together: shared live terminals, a code editor, and app previews, in your own cloud. Agents run as real CLIs in persistent tmux sessions on your team's VM, streamed live to the browser, so every steering mechanic in this guide works exactly as the vendor built it. The difference is who can reach them.

Teammates open the same workspace and watch the same live session as it runs, which turns drift-spotting from one person's peripheral vision into something the whole team can do. When a teammate needs to do more than watch, typing into someone else's terminal is delegated, not assumed: the session owner approves a control request in one click and keeps their own input. Each workspace runs in its own isolated git worktree, so a drifting run never contaminates a teammate's work, and sessions survive a closed laptop, so the run you need to redirect is still there when you get back. Visibility stays owner-managed: team-visible, or private and shared with specific people.

The Free plan is a personal sandbox for one person: AQ creates a private machine in an isolated network, nothing to install, no time limit. The Team plan is $50 per user per month in early access (standard $200, billed monthly), covers VMs you connect from your own cloud or a dedicated always-on AQ-managed VM, and locks your rate for your first 12 months.

Honestly: if you run one agent at a time in one local terminal, the vendor keybindings above are all you need. Shared steering earns its place when runs outlive your attention span, or when the person best qualified to correct a session is not the one who started it.

Frequently asked questions

Does pressing Esc in Claude Code lose the agent's work?

No. Esc stops the current response or tool call mid-turn, but the session, its context, and every completed edit survive, and anything you had queued is sent immediately. What you lose is only the action that was in flight. The documented exception to keep in mind is rewind, not Esc: Claude Code's checkpoint restore does not cover files changed by shell commands, so commit to git before large risky steps.

Should I interrupt a coding agent or queue a correction?

Queue first, interrupt second. A queued message (Enter in Claude Code, Tab in Codex CLI) is delivered at a safe boundary and preserves in-flight work, which is right for most course corrections. Interrupt (Esc) when the agent is actively editing the wrong files, running a destructive command, or burning time on a path you have already rejected. Escalate to rewind only when the bad path has already landed in code or contaminated the conversation.

How do I undo what a coding agent did after a bad run?

Use the built-in rewind first if you are in Claude Code: double Esc opens a checkpoint menu that can restore code, conversation, or both to any earlier prompt. Its limits are documented, though: it only tracks the agent's own file edits, not changes made through shell commands. Git is the fallback that always works, which is why committing before a big pivot and running each agent in its own worktree are the two habits that make every recovery cheap.

Can a teammate redirect a coding agent session I started?

On most local CLI setups, no: the session lives in your terminal and only your keyboard reaches it. As of August 2026, Cursor documents team follow-ups for its cloud agents (teammates who can view the agent and access its repository can send messages to a running agent). The general-purpose version is a shared execution surface: on AQ, teammates watch the same live tmux session in the browser, and the session owner can approve a control request in one click when someone else should drive.

How do I stop a coding agent from drifting in the first place?

Give the run a contract to steer against. Plan-first modes make the agent propose an approach you approve before it edits, executable specs and tests fail loudly the moment the agent wanders, and small scoped tasks drift less than open-ended ones. None of this eliminates mid-run steering: plans go stale when the codebase disagrees with them, so the winning setup is a clear contract up front plus a cheap way to notice and correct divergence while the run is live.