Repository navigation
Agent suggestions
Public previewDescription
Summary
Claude/Anthropic sessions never appear in the Agent Sessions view because the one-time chat discovery pass for the Claude provider silently "succeeds" (without ever emitting any sessions) when the SDK readiness check happens to return false at that exact moment — which happens on effectively every cold start and window reload. Since the SDK readiness check normally flips to true only ~2-4 seconds later, the discovery pass never gets a chance to actually list the sessions, and nothing re-triggers it afterward.
Environment
- VS Code (Stable), Agent Host / Copilot Chat "Agent Sessions" view
- Provider: Claude (Anthropic), with prior Claude Code CLI session history already present under
~/.claude/projects/ chat.agentSessions.showExternaltested with all values (recent,last24Hours,last7Days,last30Days) — no effect- Reproduces on Linux
Steps to reproduce
- Have existing Claude Code CLI session history (e.g. sessions created via the Claude CLI/extension on a previous day).
- Start VS Code fresh (cold start), or use
Developer: Reload Window, or fully quit and relaunch VS Code. - Inspect the agent host log (
~/.config/Code/logs/<timestamp>/agenthost.log). Observe, during the very first chat-discovery pass:[Claude] SDK not downloaded yet; deferring chat discovery - A few seconds later in the same log, observe the SDK actually becomes available (e.g.
[Claude] Models refreshed (merged). Count: 7, ...), and new Claude chats can be created/used normally from this point on. - Open the Agent Sessions view. No Claude/Anthropic sessions are listed, regardless of the
chat.agentSessions.showExternalsetting. - Repeat step 2 (reload window, or fully quit/relaunch) any number of times — the same race recurs on every restart, and Claude sessions never appear.
Expected
Chat discovery for the Claude provider should retry (or be re-triggered) once the SDK becomes available, so previously-created Claude sessions eventually show up in the Agent Sessions view.
Actual
Discovery never retries and Claude sessions are permanently absent from the Agent Sessions view for the lifetime of the window, even after the SDK is confirmed ready and chat itself works normally.
Notes on likely cause
Skimming the shipped agentHostMain.js, _startClaudeCodeChatDiscovery() wraps its discovery function in a retry helper that appears to retry only when the wrapped function throws. When the SDK-readiness check (canLoadWithoutDownload()) returns false, the function logs "SDK not downloaded yet; deferring chat discovery" and returns normally instead of throwing — which the retry wrapper seems to treat as a completed (non-retryable) attempt. The only other path that seems to re-trigger discovery is a user-facing "download SDK" / "reload agent configuration" flow, which doesn't surface as a prompt when chat itself is already functional (as is the case here, since Claude chats work fine once the SDK is ready — only the sessions list is stuck).
Related
- AHP listSessions fails globally when Claude provider catalog is unavailable #332830 (closed) describes a related but distinct symptom:
listSessionsthrowing entirely when the Claude catalog is unavailable. This issue is different — discovery doesn't throw/fail loudly, it silently no-ops and is never retried, so the Agent Sessions view just quietly shows nothing for Claude with no error surfaced anywhere.
Activity
Eric-SHENNONGSHI commentedon Sep 3, 2026
Confirmed workaround
For anyone hitting this before it's fixed upstream: manually invoking
workbench.action.chat.agentHost.downloadAgentSdkwith arg"claude"(e.g. via a custom keybinding) reliably fixes this, whereasworkbench.action.chat.agentHost.reloadAgentConfigurationdoes not — it still races and logsSDK not downloaded yet; deferring chat discoveryeven when triggered manually well after startup.The difference (from
agentHostMain.js):reloadAgentConfiguration→_restartChatDiscovery()directly, with no wait for SDK readiness — hits the same race as automatic startup discovery.downloadAgentSdk→_download()→await this._agent.downloadSdk()(which isensureAvailable(): awaitscanLoadWithoutDownload(), and iffalse, awaits fullloadSdkRoot()) → then_lookAgain()→restartChatDiscovery()+refreshModels(). Because this awaits actual SDK availability before re-running discovery, it doesn't race and the previously-hidden Claude sessions correctly appear in the Agent Sessions view afterward.Example keybinding used to confirm this:
{ "key": "ctrl+k ctrl+r", "command": "workbench.action.chat.agentHost.downloadAgentSdk", "args": "claude" }This doesn't fix the underlying startup race (Claude sessions still won't appear automatically on a fresh window until this is manually triggered), but it's a reliable manual recovery in the meantime.
nooma-42 commentedon Sep 4, 2026
same here
kasra0 commentedon Sep 18, 2026
same here
interconnectedMe commentedon Oct 8, 2026
Possibly related to the missing-session-list issue I just reported: #340573
Claude is one of the affected sources in my VS Code 1.141.0 native Chat Sessions view. The Claude and Codex source filters are enabled, but most existing sessions from both providers are absent after Reset, Refresh, and Reload Window. The Codex local store remains populated, and VS Code's session-state store contains Codex and Claude resource URIs.
Your reported Claude SDK readiness race and the
workbench.action.chat.agentHost.downloadAgentSdkworkaround may explain the Claude portion, but do not explain why Codex sessions are also absent. I have not tried that command yet.interconnectedMe commentedon Oct 8, 2026
Follow-up to my earlier “possibly related” comment: we have verified a resolution for the Codex portion of #340573.
Setting this explicitly in the active profile restored Codex history and pinned chats immediately, before a window reload. They opened correctly in editor tabs and survived Developer Reload Window. Rolling back to 1.140.0 alone had not helped; we are now back on 1.141.0 with the setting retained and the Codex workflow working.
The Codex recovery is separate from the Claude readiness race reported here. Our Claude log also contained
SDK not downloaded yet; deferring chat discovery, but we have not verified that it subsequently became ready without discovery retrying, nor verified Claude recovery.Details and scope clarification: #340573
interconnectedMe commentedon Oct 8, 2026
Follow-up: Claude history is now accessible again as well, through a separate recovery step from the Codex preference workaround.
Before this step, the 1.141.0 agent-host log repeatedly reported:
We invoked VS Code's built-in
workbench.action.chat.agentHost.downloadAgentSdkcommand with argument"claude"using a temporary keybinding (removed after testing). The download completed successfully for Claude SDK 0.3.281, then the same running agent host logged:The user then opened a recovered Claude conversation in native Chat and compared it with the Claude Code extension sidebar; the same historical messages were visible in both. This verifies discovery and history access, not sending a new message or post-restart persistence.
chat.agentSessions.showExternalwas set tolast30Daysin the active profile during this test.This establishes an SDK-availability/discovery prerequisite in our case. It does not establish the specific readiness race in #334170: we did not observe the SDK becoming ready spontaneously after startup while discovery failed to retry. The explicit SDK download successfully triggered discovery without a full window reload. No session-store deletion or index rebuild was needed.
Codex was restored separately using
"chat.editor.codex.preferAgentHost": false. Both recoveries were confirmed on VS Code 1.141.0.interconnectedMe commentedon Oct 15, 2026
Follow-up from 2026-10-15 on Ubuntu/Linux x64, now running VS Code 1.142.0 (
6d62b1d5dace93a33b3a6d3eca1317bd5e15bcb1) with Claude Code extension 2.1.300.Today's symptom is that newly created Claude sessions are missing from the native Chat Sessions sidebar. The user reports that, as far as they can tell, all of today's sessions are absent; we did not manually inspect the entire older history.
Read-only inspection found:
agenthost.logreportsdiscovery for provider claude: 172 candidate(s) (172 external), 0 registered, 172 already registered, 0 suppressed as subagent/chat backing, 0 skipped as older than 30 days.agent-host-claudeentries, all unarchived. Older sessions have therefore reached the native data model; this is not evidence of complete discovery failure.chat.agentSessions.showExternaltolast30Days, and the host configuration agrees. No saved provider-exclusion filter was found in the inspected state stores.Inspection of the shipped
agentHostMain.jsshows_startClaudeCodeChatDiscovery()memoizing its discovery promise after success, without a periodic scan or filesystem watcher in that path. The native list store's refresh also returns early once its cache is valid. This is consistent with new external Claude sessions remaining undiscovered after startup.We have not restarted the local agent host or fully restarted VS Code during this investigation, so recovery by restart has not yet been verified on this installation. The upstream test plan #331122 recommends Developer: Restart Local Agent Host when new external sessions are not discovered.
This is a different failure mode from the SDK-readiness race in this issue: today's startup discovery succeeded. Our earlier SDK-download recovery is documented in #340573; today's evidence instead aligns with #335215. Posting this distinction to avoid treating every missing-Claude-session symptom as an SDK-readiness failure.