[BUG] ANTHROPIC_AUTH_TOKEN vs CLAUDE_CODE_OAUTH_TOKEN

Resolved 💬 3 comments Opened Oct 11, 2025 by markNZed Closed Oct 11, 2025

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?

I am using Docker so wanted to use the OAuth token instead of browser authorization. On my host I ran claude setup-token which gave me the token and stated: Use this token by setting: export CLAUDE_CODE_OAUTH_TOKEN=<token> but to get claude CLI to use the token in the Docker container I needed to, instead, set ANTHROPIC_AUTH_TOKEN

The user experience when running Claude inside a container is poor. The browser authorization is not providing an option to get a code that can then be copy pasted into the Claude CLI. It is frusrtating that claude CLI asks for a code to be copied in but there is no explanatin of how/where to get this code (and it is not the OAuth token it seems.

What Should Happen?

Use the correct env variable name in the message or in the code.

Error Messages/Logs

Steps to Reproduce

Try using Claude from inside a docker container without running it on the host.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.0.14

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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