[BUG] Response appears before user's prompt — inverted display order in terminal

Resolved 💬 2 comments Opened Feb 25, 2026 by yosshi008 Closed Mar 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

In the terminal CLI, the display order of conversation turns is frequently inverted: Claude's response appears first, and the user's original prompt appears below it (at the bottom of the output). This makes the conversation flow confusing and hard to follow.

This is not a one-off glitch — it happens consistently across all sessions, regardless of the topic or length of conversation. The expected top-to-bottom order (user prompt → Claude response) is reversed.

Expected Behavior

The conversation should display in chronological order:

  1. User's prompt (top)
  2. Claude's response (below)

Actual Behavior

The display order is inverted:

  1. Claude's response (top)
  2. User's prompt (bottom)

This makes it look like Claude answered a question that hasn't been asked yet, followed by the question appearing afterwards.

Environment

  • Claude Code version: 2.1.42
  • OS: macOS 26.3 (Build 25D125)
  • Shell: zsh
  • Interface: Terminal CLI (not VSCode extension)

Steps to Reproduce

  1. Open Claude Code in terminal
  2. Send a prompt that triggers a moderately long response (e.g., ask for a schedule or plan)
  3. Observe that Claude's answer renders first, and the user's input message appears at the bottom after the response

Additional Context

  • Reproducible across all sessions, not just long ones
  • Possibly related to #24691 (streaming text disappears when followed by tool calls) and #826 (scroll issues in long sessions), but this is a distinct display ordering issue
  • The issue makes multi-turn conversations difficult to follow since the visual flow is reversed

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗