[BUG] VS Code extension: Remote Control fails in devcontainers until CLI is manually authenticated

Resolved 💬 3 comments Opened Mar 24, 2026 by dunglas Closed Apr 23, 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?

The VS Code extension's Remote Control feature fails in devcontainers with:

Remote Control failed to connect: Remote Control initialization failed

The CLI logs:
[bridge:repl] Skipping: bridge not enabled

Root Cause

The extension stores OAuth tokens in VS Code's SecretStorage, but the CLI subprocess it spawns reads credentials from ~/.claude/.credentials.json on disk. In a fresh devcontainer, that file doesn't exist until the user manually runs claude
from the terminal (which triggers login and writes credentials to disk).

Environment

  • Claude Code extension & CLI: v2.1.81
  • VS Code: 1.112.0
  • Container: Debian-based (linux-arm64), running as nonroot user
  • devcontainer feature: ghcr.io/devcontainers-extra/features/claude-code:1

Workaround

Run claude once from the devcontainer terminal to authenticate. Credentials persist across container restarts but not full rebuilds.

What Should Happen?

The extension should either:

  • Pass its OAuth tokens to the CLI subprocess (via env var, fd, or stdin), so the CLI doesn't need independent on-disk credentials
  • Or automatically trigger CLI authentication when it detects credentials are missing on disk but available in secure storage

Error Messages/Logs

[bridge:repl] Skipping: bridge not enabled

Steps to Reproduce

  1. Create a devcontainer with the Claude Code extension (anthropic.claude-code) and CLI (ghcr.io/devcontainers-extra/features/claude-code:1)
  2. Build and open the devcontainer
  3. Open the Claude Code panel in VS Code — the extension authenticates fine (logs show "OAuth tokens found in secure storage")
  4. Try /remote-control — fails with "Remote Control initialization failed"
  5. Open terminal, run claude — authenticate via browser
  6. Try /remote-control again — works

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.81 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗