[BUG] VS Code extension: large resumed sessions show truncated scrollback and re-ask already-answered questions (persists across reload and full restart)

Status Open
Reported on v2.1.215
Maintainer reply None cached
Activity 0 comments · opened Jul 19, 2026

What's Wrong?

Opening a large, actively-growing local session (~2,050 turns / ~5.8MB .jsonl) via the Claude Code VS Code extension's sessions sidebar shows only a truncated portion of the conversation. Scrolling to the top of the visible pane does not reach the actual start of the conversation — the earliest visible message corresponds to a point well after the conversation began, and that point appears to move later as the session keeps growing.

This is not purely a rendering issue. While continuing to work inside the resumed session, Claude re-asks questions the user has already answered earlier in the same conversation — indicating the history actually sent back to the model on resume may also be incomplete, not just what's displayed in the webview.

Confirmed this is not stale client-side state: the truncation persists after "Developer: Reload Window" and after a full quit-and-relaunch of VS Code. The extension's own log shows it spawns a brand-new CLI subprocess (via the SDK query function) with resume: <session-id> fresh on every open — so whatever limits the visible/replayed history is being decided freshly each time, not served from a cache.

What Should Happen?

The full conversation history should be scrollable in the UI, and the complete prior context should be sent to the model when resuming a session, regardless of session size/turn count.

Error Messages/Logs

From Claude VSCode.log (extension host log), redacted of local paths/usernames:

[info] Spawning Claude with SDK query function - cwd: <project-dir>, permission mode: auto, version: 2.1.215, .../resources/native-binary/claude, resume: <session-id>
[info] From claude: [DEBUG] FileHistory: No need to copy file history for resuming with same session id: <session-id>
[info] From claude: [DEBUG] autocompact: tokens=[REDACTED] level=ok effectiveWindow=947000

This same resume: <session-id> spawn sequence recurs identically on every reopen, including after a full VS Code restart, timestamped hours apart.

Steps to Reproduce

  1. Work in a single Claude Code session inside the VS Code extension for a very long time (this session reached ~2,050 turns / ~5.8MB in ~/.claude/projects/<project>/<session-id>.jsonl).
  2. Open that session from the Claude Code sessions sidebar to view/resume it.
  3. Scroll to the top of the conversation pane.
  4. Observe: the earliest visible message is not the actual first message — it starts partway through (in this case, around a specific implementation step well after the session began).
  5. Verify the underlying .jsonl is not the cause: every line is valid JSON, sessionId/cwd are consistent throughout, no isCompactSummary markers are present, and the file continues to grow correctly — i.e., this is not data loss on disk.
  6. Run "Developer: Reload Window" — truncation persists.
  7. Fully quit and relaunch VS Code — truncation still persists.
  8. Continue working in the resumed session — Claude re-asks questions already answered earlier in the same conversation, suggesting the resumed model context is also incomplete, not only the displayed scrollback.

Additional Information

  • Extension's own on-disk caches were checked and ruled out: agentSessions.model.cache (a VS Code workspace-state key) stores only lightweight per-session metadata (title, timestamps, git diffstat) — never message content — so it isn't the source of the truncation.
  • Bundled native binary version: 2.1.215 (anthropic.claude-code-2.1.215-darwin-arm64/resources/native-binary/claude), distinct from the separately-installed CLI (/opt/homebrew/bin/claude, 2.1.177) — not yet tested whether the standalone CLI's own --resume reproduces this, since running it would append a new turn to the transcript under investigation.
  • Likely specific to unusually large sessions; may not reproduce on smaller ones.
  • Possibly related to anthropics/claude-code#67434 (Claude Desktop fails to display earlier history for long, multi-compact conversations on Windows) — but that report states CLI --resume displays the full transcript correctly and only the Desktop UI is affected. Here, the VS Code extension is the affected surface, and behavior suggests the resumed model context itself may be incomplete, not only the UI — worth confirming whether these share a root cause.
  • Possibly related to anthropics/claude-code#69013 (duplicate mode/permission-mode system messages padding out resumed sessions) — this session's .jsonl does contain some duplicate mode/system entries, but at a much lower ratio (~185 of 2,050 lines) than the 6:1 ratio reported there, so it doesn't appear to be the same mechanism, though a related contributing factor isn't ruled out.

View original on GitHub ↗