claude-code - 💡(How to fix) Fix Queue messages to send at true end-of-turn, not next LLM pause [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49373Fetched 2026-04-17 08:42:58
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
1
Author
Timeline (top)
labeled ×2commented ×1

Root Cause

Why it matters This breaks long autonomous sessions. Codex lets you stack 5 prompts, walk away for an hour, and come back to finished work. In Claude Code, there's no reliable way to line up follow-ups because you can't predict when the queue will flush.

Fix Action

Fix / Workaround

Workarounds today

  • Bundling everything into one mega-prompt (fragile, no course-correction).
  • Stop hooks that inject from a file (hacky, per-user setup).
  • /loop (not really the same thing).
RAW_BUFFERClick to expand / collapse

Problem In the Claude Code desktop/web app, messages typed while Claude is working are queued — but they all flush at the next LLM pause, not at true end-of-turn. That includes pauses between tool calls, after a subagent returns, or any intermediate stop. In practice this means queued messages often get injected mid-task and derail whatever Claude was doing.

Why it matters This breaks long autonomous sessions. Codex lets you stack 5 prompts, walk away for an hour, and come back to finished work. In Claude Code, there's no reliable way to line up follow-ups because you can't predict when the queue will flush.

Request An "end-of-turn only" queue mode (setting, flag, or per-message toggle) so queued messages wait until Claude has fully completed the current task before the next one is sent.

Workarounds today

  • Bundling everything into one mega-prompt (fragile, no course-correction).
  • Stop hooks that inject from a file (hacky, per-user setup).
  • /loop (not really the same thing).

None of these match the ergonomics of a proper message queue.

extent analysis

TL;DR

Implement an "end-of-turn only" queue mode to ensure messages are sent after Claude has fully completed the current task.

Guidance

  • Identify the current queue flushing mechanism and modify it to wait for the true end-of-turn signal, rather than intermediate pauses.
  • Introduce a setting, flag, or per-message toggle to enable the "end-of-turn only" queue mode, allowing users to control when queued messages are sent.
  • Consider adding a callback or hook that notifies the queue when Claude has completed a task, triggering the sending of queued messages.
  • Review the existing workarounds (e.g., bundling prompts, stop hooks, /loop) to understand their limitations and inform the design of the new queue mode.

Example

No code snippet is provided as the issue does not contain specific technical details about the current implementation.

Notes

The solution may require significant changes to the queue management and task completion detection mechanisms. The "end-of-turn only" queue mode should be designed to work seamlessly with the existing features, such as stacked prompts and autonomous sessions.

Recommendation

Apply a workaround, such as bundling prompts or using stop hooks, until a proper "end-of-turn only" queue mode can be implemented, as it provides a more reliable and ergonomic solution for users.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING