Environment
- Claude Code VSCode native extension (Linux)
Description
The chat viewport anchors to the most recent user-role message, so when I scroll through the conversation my last prompt is pinned/visible at the top. This is the expected and useful behavior.
However, harness-injected blocks (<task-notification> from background Bash / background agents / workflows, and similar system-injected content) are delivered as user-role messages. The scroll anchoring doesn't distinguish them from messages the human actually typed, so once a background task completes, the anchor jumps to the latest injected notification and my real prompt scrolls out of view.
Steps to reproduce
- Send a prompt that causes Claude to start a background task (e.g. a
run_in_background Bash command or a background subagent).
- Wait for the task to complete so a
<task-notification> is injected into the conversation.
- Scroll up/down through the conversation.
Expected
The anchored/pinned message is the last prompt the user actually typed.
Actual
The anchor is the last injected <task-notification> block, which reads as if it came from the user.
Suggested fix
When computing the scroll anchor (and any "last user message" affordances), skip system-injected user-role content (task notifications, system reminders, hook output) and anchor to the last human-authored message.
Environment
Description
The chat viewport anchors to the most recent user-role message, so when I scroll through the conversation my last prompt is pinned/visible at the top. This is the expected and useful behavior.
However, harness-injected blocks (
<task-notification>from background Bash / background agents / workflows, and similar system-injected content) are delivered as user-role messages. The scroll anchoring doesn't distinguish them from messages the human actually typed, so once a background task completes, the anchor jumps to the latest injected notification and my real prompt scrolls out of view.Steps to reproduce
run_in_backgroundBash command or a background subagent).<task-notification>is injected into the conversation.Expected
The anchored/pinned message is the last prompt the user actually typed.
Actual
The anchor is the last injected
<task-notification>block, which reads as if it came from the user.Suggested fix
When computing the scroll anchor (and any "last user message" affordances), skip system-injected user-role content (task notifications, system reminders, hook output) and anchor to the last human-authored message.