[BUG] Tool call / agent card renders above its own introduction text — message order reversed in TUI
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?
When Claude says something like "Let me invoke the XXX skill" or "I'll spawn a sub-agent to help" and then makes a tool call or spawns an agent in the same turn, the tool call / agent card renders ABOVE the introduction text instead of below it.
For example, Claude first displays: "I'll help you search with the exa-search skill."
Then the tool call card appears — but it renders ABOVE that sentence, pushing it down. The visual order becomes:
[Tool call card] ← should be BELOW
"I'll help you search..." ← should be ABOVE
The text is not lost, it's still there — it's just rendered in the wrong position. This makes conversation flow confusing because the explanation appears after the action it's explaining.
This happens on macOS (all terminals: Ghostty, iTerm2, Terminal.app) but NOT on Windows. Both tool calls and sub-agent spawns are affected.
What Should Happen?
The introduction text should render ABOVE the tool call / agent card, in the same order the model emits them. Within a single assistant message, the text always comes before the tool_use block, so the TUI should preserve that natural order:
"I'll help you search with the exa-search skill." ← text first
┌──────────────────────────┐
│ 🔧 Skill: exa-search │ ← tool card below
└──────────────────────────┘
Error Messages/Logs
Steps to Reproduce
- Open Claude Code on macOS in any terminal (Ghostty, iTerm2, Terminal.app)
- Type any prompt that causes Claude to say it will invoke a skill or spawn a sub-agent, then actually do it. Examples:
- Ask Claude to "search for the latest React documentation online"
- Ask Claude to "do a deep research on WebAssembly component model"
- Any prompt that triggers Claude to use the Skill tool or Agent tool
- Observe the conversation display:
- Claude's introductory text appears first (e.g., "I'll invoke the exa-search skill for you...")
- Then the tool call / agent card renders — but it appears ABOVE the introductory text
- Compare with the expected order:
- Expected: text above, tool card below
- Actual: tool card above, text below
- (Optional) Try the same prompt on Windows — the bug does NOT reproduce there, confirming it's a macOS-specific TUI rendering issue.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.195
Platform
Other
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗