[BUG] Panel webview visibly re-lays out (shrinks to minimum, then expands) every time the Claude tab is revealed

Status Open
Reported on v2.1.223
Maintainer reply None cached
Activity 0 comments · opened Aug 6, 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?

Environment

  • Extension: anthropic.claude-code 2.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

  1. Open Claude Code in the bottom panel (claudeCode.preferredLocation: "panel").
  2. Have a conversation with enough history to fill the view.
  3. Switch to another panel tab (Terminal / Problems / Output).
  4. Switch back to the Claude Code tab.
  5. 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, or
Claude 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

  1. Open Claude Code in the bottom panel (claudeCode.preferredLocation: "panel").
  2. Have a conversation with enough history to fill the view.
  3. Switch to another panel tab (Terminal / Problems / Output).
  4. Switch back to the Claude Code tab.
  5. 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_

View original on GitHub ↗