Navigation
Copy page

Steer a Running Turn

On this page

kli keeps reading your input while a turn is in flight. You do not have to wait for the model to finish before you correct its course, add a constraint, or stop it. This page covers the three ways to redirect a turn that is already running: steering, follow-up, and aborting with Esc.

Steer: inject guidance at the next tool boundary

Type a message and press Enter while kli is working. The turn keeps running, and your message is queued as steering. kli delivers it at the next tool boundary: after the current tool call returns, before the model issues the next one. The remaining tool calls in that batch are skipped, your message lands in the conversation, and the model reacts to it on the following turn.

A turn that makes no tool calls has no mid-turn boundary. A steer queued during such a turn is delivered when the turn ends, so it runs as the next turn rather than waiting for a boundary that never comes.

Steering is the default for anything you submit while a turn is in flight. You do not press a special key or prefix the message; an ordinary Enter during a running turn steers.

Follow-up: queue a message for after the run

A follow-up message is held until the whole turn completes, then delivered as the next turn. Unlike steering, it never interrupts tool calls or cuts a batch short. Use it when the current work is correct and you want to add the next instruction without disturbing what kli is already doing.

Set the delivery mode

Both queues default to delivering everything you have submitted in one pass when their boundary arrives. If you submit three steering messages while kli works, all three land together at the next tool boundary. You can switch either queue to deliver one message per boundary instead.

Set these in settings.json (global ~/.config/kli/settings.json, project <repo>/.kli/settings.json; project wins) — see Settings:

json
{
  "steeringMode": "one-at-a-time",
  "followUpMode": "all"
}

steeringMode controls how many queued steering messages drain per tool boundary; followUpMode does the same for follow-up messages after the turn ends. Set either to "one-at-a-time" to deliver exactly one queued message per boundary, leaving the rest to drain at later boundaries. The default, "all", drains every queued message in that queue at once. Leave a key out to take the default; an unrecognized value is ignored with a warning, and the default applies.

For the full settings reference, see Settings.

Abort or rewind with Esc

Esc does one of two things depending on whether a turn is running.

While a turn is in flight, Esc aborts it. The first press arms and shows Press Esc again to interrupt.; a second press within about 1.5 seconds stops the turn. A lone Esc does nothing, so a misclick cannot interrupt your work. If the window lapses, the next Esc re-arms.

What the abort leaves behind depends on how far the turn had progressed:

  • If the model had not yet streamed any reply, the prompt you sent is un-sent: the row is removed from the transcript and your text is restored to the editor, so you can revise and resend it. If turn entries have already been committed, the prompt stays sent and kli shows an Interrupted. notice instead.
  • If the reply was already streaming, kli marks that reply as aborted in place and stops the turn.

At an idle prompt with a conversation behind you, Esc rewinds. The first press shows Press Esc again to rewind.; a second press within the window opens a menu of your past prompts. Move with Up and Down, press Enter to rewind to the state before the chosen prompt, and Esc to dismiss the menu. Rewinding to before a prompt restores that prompt's text to the editor.

On an empty conversation, or when there is nothing to rewind, Esc is a no-op.