[BUG] Panel webview visibly re-lays out (shrinks to minimum, then expands) every time the Claude tab is revealed
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?
Environment
- Extension:
anthropic.claude-code2.1.223 (win32-x64) - VS Code: 1.132.0
- OS: Windows Server 2019 Standard, 10.0.17763
claudeCode.preferredLocation:panel(default)
What happens
When the Claude Code view lives in the bottom panel and I switch away from it
(e.g. to the Terminal tab) and then switch back, the webview content visibly
re-lays out on every reveal: it first collapses to a minimum size, then expands
to the real size. The process takes a few seconds, during which the chat is
unusable.
This happens on every single reveal, not just the first one.
Steps to reproduce
- Open Claude Code in the bottom panel (
claudeCode.preferredLocation: "panel"). - Have a conversation with enough history to fill the view.
- Switch to another panel tab (Terminal / Problems / Output).
- Switch back to the Claude Code tab.
- Observe the content collapse and then expand over several seconds.
Expected
Revealing an already-open view should be instant, with the content already at
its correct size — the same as switching between Terminal and Output tabs.
Trigger is reveal, not focus
Verified: if the view is placed somewhere it stays visible, the re-layout never
happens — losing and regaining focus alone does not trigger it. Only hiding and
re-revealing the view does.
Notes from a quick look at the shipped bundle
extension.js already sets retainContextWhenHidden: true on the webviews
(5 occurrences), so the webview context is not being torn down and this is not
a conversation reload. Together with the observation above, this points at the
content re-measuring itself on reveal — e.g. a virtualized message list
measuring from a zero/near-zero container size before the iframe is restored to
its actual dimensions — rather than at a missing retainContextWhenHidden.
This is a hypothesis from reading the bundle, not a verified root cause.
Impact
The bottom panel is the default location, and it shares space with the
terminal, so this reveal cycle happens constantly during normal work. There is
no user-facing setting that affects it: none of the claudeCode.*
configuration properties relate to webview layout.
Workaround
Keeping the view somewhere it is never hidden avoids the problem entirely
(Claude Code: Open in Side Bar, a separate editor group, orClaude Code: Open in New Window), at the cost of giving up the panel layout.
What Should Happen?
Revealing an already-open view should be instant, with the content already at
its correct size — the same as switching between Terminal and Output tabs.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code in the bottom panel (
claudeCode.preferredLocation: "panel"). - Have a conversation with enough history to fill the view.
- Switch to another panel tab (Terminal / Problems / Output).
- Switch back to the Claude Code tab.
- Observe the content collapse and then expand over several seconds.
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.223
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_