Skip to content

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

Description

@louy

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:authbugSomething isn't workinghas reproHas detailed reproduction stepsstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions