[BUG] Login callback URL does not work when used in a dev container, callback server most likely listening on 127.0.0.1

Resolved 💬 2 comments Opened Mar 5, 2026 by louy Closed Apr 2, 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?

When using Claude Code in a dev container, and trying to login using a Claude account (/login and first option), the browser opens successfully and I am able to authorise Claude Code in the web UI.

However, when I get redirected to the callback URL (localhost with port 50XXX or something) my browser hangs.

I can see that the port is forwarded to the dev container in VSCode, meaning the issue is that Claude Code is not listening to requests from the docker host. My suspicion is that the callback server is listening to requests from localhost only.

This happens both in Claude Code CLI and in the VSCode extension (GUI).

This happens to everyone in my team (tested with 4 different users) and different browsers.

What Should Happen?

/login flow should work all the way through

Error Messages/Logs

No errors, browser hangs on last step (callback url)

Steps to Reproduce

  1. Start a dev container using the official setup
  2. claude /login
  3. Use account login
  4. Hang on the last step, having to re-do the flow by clicking the link and pasting a code (skipping callback url)

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.69 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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