CLAUDE_CODE_OAUTH_TOKEN breaks Chrome extension (--chrome)

Resolved 💬 5 comments Opened Mar 1, 2026 by djeshkov Closed May 18, 2026

Bug description

Setting the CLAUDE_CODE_OAUTH_TOKEN environment variable causes the Chrome extension (--chrome / Claude in Chrome) to stop working. The extension reports "browser extension is not connected" even though it shows "Connected" in Chrome toolbar.

Steps to reproduce

  1. Log into Claude Code via browser login (claude → authenticate in browser)
  2. Install Chrome extension, verify it shows "Connected"
  3. Verify Chrome works: claude --print --chrome -p 'Call tabs_context_mcp'works
  4. Set export CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-... (valid token)
  5. Run same command: claude --print --chrome -p 'Call tabs_context_mcp'"browser extension is not connected"
  6. unset CLAUDE_CODE_OAUTH_TOKENworks again

Expected behavior

Chrome extension should work regardless of which authentication method is used. Or at minimum, there should be a clear error message like "Chrome extension requires browser login, CLAUDE_CODE_OAUTH_TOKEN is not supported".

Environment

  • Claude Code: 2.1.63
  • Chrome extension: 1.0.56
  • macOS (Apple Silicon)
  • Chrome 145.0.7632.117

Impact

This is particularly painful for automated/daemon setups where CLAUDE_CODE_OAUTH_TOKEN might be set in .env files. The failure is silent — Claude CLI exits 0 and just says extension is not connected, making it very hard to diagnose. We spent ~2 hours debugging this.

Workaround

Don't set CLAUDE_CODE_OAUTH_TOKEN when using --chrome. Use browser login only (~/.claude/.credentials.json).

View original on GitHub ↗

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