CLAUDE_CODE_OAUTH_TOKEN breaks Chrome extension (--chrome)
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
- Log into Claude Code via browser login (
claude→ authenticate in browser) - Install Chrome extension, verify it shows "Connected"
- Verify Chrome works:
claude --print --chrome -p 'Call tabs_context_mcp'→ works - Set
export CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...(valid token) - Run same command:
claude --print --chrome -p 'Call tabs_context_mcp'→ "browser extension is not connected" unset CLAUDE_CODE_OAUTH_TOKEN→ works 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).
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗