VS Code: session resume from claude.ai/code fails with lock contention and expired OAuth token

Resolved 💬 1 comment Opened Mar 29, 2026 by sproctor42 Closed Mar 29, 2026

Bug description

Attempting to resume a web Claude Code session (claude.ai/code) in the VS Code extension fails silently. The session appears to load but no context transfers. The extension log reveals multiple cascading errors.

Environment

  • Claude Code VS Code extension: v2.1.86 (win32-x64)
  • OS: Windows 11 Pro 10.0.26200
  • Shell: Git Bash (C:\Program Files\Git\bin\bash.exe)
  • Model: claude-opus-4-6[1m]

Steps to reproduce

  1. Start a Claude Code session on claude.ai/code connected to a GitHub repository
  2. Do substantive work in the web session (research, issue creation, etc.)
  3. Open VS Code with the same repository
  4. Attempt to resume the web session in VS Code (the session appears in the session list)
  5. Select the session to resume

Expected: Session context loads in VS Code and work continues seamlessly
Actual: Session appears to load but context does not transfer. Extension logs show errors.

Errors observed in extension log

1. Dual process spawn — lock file race condition

The extension spawns two Claude binary processes within milliseconds of each other — one for init and one for resume — and they contend on the config lock file:

Spawning Claude with SDK query function - cwd: ..., resume: undefined
Spawning Claude with SDK query function - cwd: ..., resume: 343efa86-061c-4268-9258-7e39581deef0
[ERROR] Failed to save config with lock: Error: Lock file is already being held

Both processes load permissions, parse settings, and initialize MCP — duplicating all startup work and racing on shared state.

2. OAuth token expired (HTTP 401)

AxiosError: [url=https://api.anthropic.com/api/oauth/organizations/.../referral/eligibility,
status=401,
body=OAuth token has expired. Please obtain a new token or refresh your existing token.]

The web session's OAuth token has expired by the time the VS Code extension attempts to use it for the resume. The extension does not appear to refresh the token before attempting the resume.

3. MCP server fetch failures

[claudeai-mcp] Fetch failed

Both spawned instances fail to fetch MCP server configurations, likely cascading from the auth failure.

4. Plugin cache directory missing

rg: C:\Users\proct\.claude\plugins\cache: IO error for operation on 
C:\Users\proct\.claude\plugins\cache: The system cannot find the file specified. (os error 2)

Ripgrep attempts to search a plugins/cache directory that doesn't exist. Not critical but adds noise.

Analysis

The root cause appears to be two issues:

  1. Race condition: The extension should not spawn two Claude binary instances simultaneously. The init spawn and the resume spawn should be sequenced, or the init should be skipped when a resume is requested.
  1. Token refresh on resume: When resuming a web session locally, the extension should refresh the OAuth token before attempting to load the session, rather than using the (potentially expired) token from the web session.

Workaround

None found — the web session context must be manually re-established in a new VS Code session.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗