[BUG] VSCode extension: auto-scroll during streaming prevents scrolling up
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?
While Claude is streaming a response, the chat panel auto-scrolls to the bottom every time a new line/token is appended. Any attempt to scroll up with a trackpad is immediately overridden — within a frame the view snaps back to the bottom. This makes it impossible to re-read earlier content (or copy from it) until the stream finishes.
Root cause appears to be in webview/index.js (v2.1.140). The "is user at bottom?" check uses a 50px threshold:
let v5 = scrollHeight - scrollTop - clientHeight;
A.current = v5 < 50;
A single trackpad scroll tick on macOS produces a delta of ~10–40px, which keeps v5 < 50 true, so the next streamed chunk re-triggers Bk(Q) and snaps to the bottom. The user can never get out of the "near bottom" window with normal trackpad use.
Patching the threshold locally to < 2 fully resolves the issue: scrolling up during streaming now works as expected, and stick-to-bottom re-engages once the user manually scrolls back to the bottom.
What Should Happen?
Stick-to-bottom should follow the standard contract:
- If the user is exactly at the bottom, snap to the bottom on new content.
- As soon as the user scrolls up by any amount, suspend auto-scroll until they manually return to the bottom.
Suggested fix: reduce the threshold from 50 to ~2 pixels, or check scrollHeight - scrollTop - clientHeight <= 1. Most stick-to-bottom libraries (e.g. use-stick-to-bottom) default to a near-zero threshold for exactly this reason.
Error Messages/Logs
Steps to Reproduce
- Install Claude Code VSCode extension v2.1.140 (anthropic.claude-code).
- Open the Claude Code panel in VSCode.
- Send any prompt that produces a long streaming response.
- While the response is still streaming, try to scroll up with the trackpad to re-read earlier content.
Expected: the view stays where the user scrolled.
Actual: the view immediately snaps back to the bottom on the next streamed chunk.
Environment:
- VSCode extension: anthropic.claude-code v2.1.140 (also reproduces on 2.1.139)
- VSCode: 1.119.0
8b640eef5a6c6089c029249d48efa5c99adf7d51
arm64
- OS: macOS 15 (Darwin 25.0.0)
- Hardware: MacBook Pro 14" M4 (built-in Liquid Retina XDR, default scaled resolution)
- Input: built-in trackpad (smooth scroll)
Note: I initially suspected a HiDPI/scaling issue, but after inspecting the bundled webview code the root cause is the 50px threshold combined with macOS smooth-scroll deltas — it's not display-specific.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
-
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗