DEV Community

VibeiDE
VibeiDE

Posted on Originally published at vibeide.dev

Claude Code queue: queue messages, tasks and background work

Originally published on vibeide.dev

Claude Code has a built-in queue: type a message and press Enter while Claude is working, and Claude Code queues it instead of interrupting the turn. Queued messages reach Claude as soon as the running tool calls finish, Ctrl+Enter sends them right away, Esc interrupts and sends them next, and Up takes them back for editing. To queue whole tasks rather than messages, start background sessions with claude --bg "<prompt>" and watch them in claude agents.

That short answer covers most searches for a Claude Code queue. The rest of this guide explains when queued entries are actually delivered, how to send, cancel or edit them, how to queue complete tasks as background sessions or scripts, and where a per-session queue stops being enough. Everything below was checked against the official interactive mode reference and agent view documentation in October 2026. Keys and versions change, so treat those pages as the source of truth.

How does the Claude Code message queue work?

You keep typing while Claude works. Each message you send with Enter is queued, listed in the conversation, and shown in gray until Claude starts responding to it, so you can see which instructions Claude has not picked up yet.

When a queued entry reaches Claude depends on what you queued (as of October 2026):

  • Messages. If you queue a message while Claude is running tool calls, Claude Code passes it to Claude as soon as those tool calls finish, inside the same turn. If the turn ends with messages still queued, they go out on their own, in the order you typed them.
  • Commands and ! shell commands. Claude Code holds them until the turn ends, then runs them one at a time in the order you queued them.
  • Setting commands. /model, /effort and /fast are not queued at all. They run as soon as you send them, and the docs explain for each one whether the change applies to the current turn or the next.

This is why queueing works well for small course corrections ("also update the README", "use the existing helper instead") and less well for a new, unrelated task. A queued message joins the current conversation and its context, so a second task typed into the queue shares the same session, the same context window and the same files.

How do I send, interrupt or edit what I queued?

Three keys control the queue. You do not need any of them for normal use, because queued messages are delivered on their own, but they matter when you change your mind.

Key What it does
Ctrl+Enter (or Ctrl+X Ctrl+S) Sends your queued messages now, with your draft queued behind them. Requires v2.1.275 or later
Esc Interrupts the turn without submitting your draft. Claude keeps the work done so far, and Claude Code sends what you queued right away
Up from the first line Takes queued messages and commands back into the input box, one per line, so you can edit them and press Enter to queue them again as one entry, or clear the box to drop them

Two details are worth knowing. First, what Ctrl+Enter does to the running turn depends on Claude's current work: shell commands, subagents and other work that can move to the background keep running in the background while Claude reads your messages in the same turn, while a turn that is only writing a response is interrupted and your messages go next. In terminals that do not report extended keys, Ctrl+Enter arrives as plain Enter and only queues the draft, so use Ctrl+X Ctrl+S there. Second, queued shell commands come back with Up only when the input box is empty and nothing else is queued; otherwise they stay in the queue and run after the turn.

If your terminal swallows these keys, our guide to the best terminal for Claude Code covers which terminals pass them through, and Claude Code commands lists the other shortcuts.

How do I queue whole tasks instead of messages?

A message queue serializes instructions inside one conversation. When you have several separate tasks, start a separate session for each one. Claude Code can run them as background sessions:

claude --bg "investigate the flaky SettingsChangeDetector test"
claude --bg --name "readme-refresh" "update the README for the new config flags"
claude agents
Enter fullscreen mode Exit fullscreen mode

claude --bg (or --background) takes the prompt as a positional argument and starts the session in the background. claude agents opens agent view, one screen that shows what is running, what needs your input and what is done. Inside a session you already have open, /bg moves it to the background, and pressing the left arrow on an empty prompt backgrounds it and opens agent view. Messages you had queued move with the session.

Agent view is a research preview as of October 2026, so keys may change. Three limits from the docs shape how you use it: --bg cannot be combined with -p, a finished or waiting session that stays unattached for about an hour has its process stopped (the conversation stays on disk and resumes when you attach), and each session uses your subscription quota independently. Ten background sessions drain a plan allowance roughly ten times faster than one, which our guide to Claude Code usage limits covers in detail.

A simple sequential queue with headless mode

If you want tasks to run strictly one after another, for example overnight, a shell loop over headless mode is enough. claude -p runs one prompt non-interactively and exits with a non-zero code when the run fails:

while IFS= read -r task; do
  claude -p "$task" --permission-mode acceptEdits || echo "failed: $task"
done < tasks.txt
Enter fullscreen mode Exit fullscreen mode

Each line becomes its own run with fresh context. Unattended runs cannot answer permission prompts, so decide up front which tools or permission mode the loop may use, as described in the headless documentation.

Which Claude Code queue fits which job?

Option Unit of work Runs Best for
Message queue A message in the current session In order, inside the same conversation Corrections and follow-ups to the task in progress
claude --bg and agent view A whole session per task In parallel, each with its own context Several independent tasks in one repository
claude -p loop One headless run per line Strictly one after another Unattended batches with known permissions

Where a per-session queue stops being enough

The built-in options queue work inside one machine's Claude Code. They do not give each project its own queue, they do not mix providers, and parallel sessions in one checkout still edit the same files. Give each parallel task its own Git worktree (see git worktree and our Claude Code worktree guide), and keep track of which task is waiting for review, or running several Claude Code sessions turns into a hunt through terminal tabs.

VibeiDE is a desktop app that coordinates the Codex, Claude Code and OpenCode CLIs you already installed. Each project has its own task queue; waiting prompts can be edited or reordered, and a task starts when its provider has a free slot, with a parallel limit per provider that you set per project. The composer mode "New worktree per task" gives each task its own Git worktree and branch, finished tasks wait in Ready for review, and slots control how many processes run at once without raising a provider allowance. See the AI agent task queue or VibeiDE for Claude Code.

FAQ

Does a queued message interrupt Claude?

No. Pressing Enter while Claude works queues the message. Only Esc, Ctrl+C or, in some cases, Ctrl+Enter interrupt the running turn.

Why does Claude read my queued message before the turn ends?

If Claude is running tool calls, Claude Code hands over queued messages as soon as those tool calls finish, within the same turn, so Claude can adjust course without waiting.

How do I cancel a queued message?

Press Up from the first line of the input box. The queued text returns to the input box, where you can edit it or clear it.

Can Claude Code run queued tasks in parallel?

The message queue is sequential. For parallel work, start separate background sessions with claude --bg and use a separate worktree per task so they do not edit the same files.

Takeaways

  • Press Enter while Claude works to queue a message; it shows in gray until Claude reads it.
  • Messages are delivered after the current tool calls finish; commands and ! shell commands wait for the end of the turn.
  • Ctrl+Enter sends the queue now, Esc interrupts and sends it next, Up takes it back to edit.
  • Queue whole tasks with claude --bg and watch them in claude agents; each session uses your quota on its own.
  • For strictly sequential batches, loop over claude -p; for parallel tasks, use one worktree per task.

Top comments (0)