[BUG] /model omits Opus 5 when authenticated via CLAUDE_CODE_OAUTH_TOKEN, but not via stored login

Status Fixed / completed
Reported on v2.1.266
Maintainer reply None cached
Activity 3 comments · opened Sep 9, 2026 · closed Sep 9, 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?

Env: Claude Code 2.1.266, Claude Pro, Linux container (headless).

▎ Repro:

▎ 1. Auth via CLAUDE_CODE_OAUTH_TOKEN (from claude setup-token), with ~/.claude/.credentials.json absent.

▎ 2. Run /model → picker shows Sonnet 5, Opus 4.8 (as the opus alias), Opus 4.8 (1M), Haiku 4.5. No Opus 5 entry.

▎ 3. But claude --model claude-opus-5 -p "reply PONG" → returns PONG (runs fine; displayed as raw/custom claude-opus-5).

▎ 4. Same account via interactive login (.credentials.json present) → /model does list Opus 5, selectable and sticky.

▎ Expected: the /model catalog should be identical for the same entitled account regardless of auth transport; Opus 5 should appear (and the opus alias resolve to it) under env-token

▎ auth, since it's runnable.

▎ Impact: CI/headless/container users can't select Opus 5 via /model or have it stick — only by explicit --model claude-opus-5.

What Should Happen?

Env: Claude Code 2.1.266, Claude Pro, Linux container (headless).

▎ Repro:

▎ 1. Auth via CLAUDE_CODE_OAUTH_TOKEN (from claude setup-token), with ~/.claude/.credentials.json absent.

▎ 2. Run /model → picker shows Sonnet 5, Opus 4.8 (as the opus alias), Opus 4.8 (1M), Haiku 4.5. No Opus 5 entry.

▎ 3. But claude --model claude-opus-5 -p "reply PONG" → returns PONG (runs fine; displayed as raw/custom claude-opus-5).

▎ 4. Same account via interactive login (.credentials.json present) → /model does list Opus 5, selectable and sticky.

▎ Expected: the /model catalog should be identical for the same entitled account regardless of auth transport; Opus 5 should appear (and the opus alias resolve to it) under env-token

▎ auth, since it's runnable.

▎ Impact: CI/headless/container users can't select Opus 5 via /model or have it stick — only by explicit --model claude-opus-5.

Error Messages/Logs

Steps to Reproduce

Env: Claude Code 2.1.266, Claude Pro, Linux container (headless).

▎ Repro:

▎ 1. Auth via CLAUDE_CODE_OAUTH_TOKEN (from claude setup-token), with ~/.claude/.credentials.json absent.

▎ 2. Run /model → picker shows Sonnet 5, Opus 4.8 (as the opus alias), Opus 4.8 (1M), Haiku 4.5. No Opus 5 entry.

▎ 3. But claude --model claude-opus-5 -p "reply PONG" → returns PONG (runs fine; displayed as raw/custom claude-opus-5).

▎ 4. Same account via interactive login (.credentials.json present) → /model does list Opus 5, selectable and sticky.

▎ Expected: the /model catalog should be identical for the same entitled account regardless of auth transport; Opus 5 should appear (and the opus alias resolve to it) under env-token

▎ auth, since it's runnable.

▎ Impact: CI/headless/container users can't select Opus 5 via /model or have it stick — only by explicit --model claude-opus-5.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.266

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

3 Comments

alainstalder · 4 days ago

actually "--model claude-opus-5" does apparently not have the desired effect either. asked inside that model then:

can you show me your model type and version?
• I'm Claude Opus 4.5 (model ID claude-opus-4-5), running as Claude Code in this container.
Note: your environment context lists the session model as claude-opus-5, and your memory file claude_code_container_opus5_token.md
(/home/node/.claude/projects/-workspace/memory/claude_code_container_opus5_token.md) covers exactly this - the setup-token rotation + pinning "model": "claude-opus-5". So the harness believes it's talking to Opus 5. I can't introspect the actual serving model, so I can only report my own self-identification, which is Opus 4.5. If you want to know what's actually being served, the reliable check is on the host side (e.g. /status, or the API response's model field), not asking me.

alainstalder · 4 days ago

ah, no, --model claude-opus-5 -p "hi" --output-format stream-json --verbose => seems still to be opus 5, but I guess you will figure out the details anyways...

alainstalder · 4 days ago

was a different cause, running in a container with base image "FROM node:20-slim" and claude via npm could not get recent versions => changed to "FROM node:22-slim" and the worked. still so that when I did first "claude setup-token" and logged in, that then I could select "Opus 5" even with the old version, but I am closing this anyway....