claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Anthropic API Error: OAuth token missing user:profile scope for usage data

Open mairaj-syed opened this issue 11 months ago • 7 comments

Bug Description When I tried to see my usage in the status bar, I saw the following error: Error: Failed to load usage data: {"type":"error","error":{"type":"permission_error","message":"OAuth token does not meet scope requirement user:profile","details":{"error_visibility":"user_facing"}},"request_id":"req_011CW1TiRmL2GDW3f5ZhB3N8"}

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.0.65
  • Feedback ID:

Errors

[{"error":"AxiosError: Request failed with status code 403\n    at Kj (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:187:1137)\n    at Unzip.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:188:9852)\n    at Unzip.emit (node:events:519:35)\n    at Unzip.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1696:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at XKA.request (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:190:2130)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async t_B (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1009:47184)","timestamp":"2025-12-11T19:34:13.881Z"},{"error":"AxiosError: Request failed with status code 403\n    at Kj (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:187:1137)\n    at Unzip.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:188:9852)\n    at Unzip.emit (node:events:519:35)\n    at Unzip.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1696:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at XKA.request (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:190:2130)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async r50 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3013:4507)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3013:6094","timestamp":"2025-12-11T19:34:29.935Z"},{"error":"AxiosError: Request failed with status code 403\n    at Kj (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:187:1137)\n    at Unzip.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:188:9852)\n    at Unzip.emit (node:events:519:35)\n    at Unzip.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1696:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at XKA.request (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:190:2130)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async r50 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3013:4507)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3013:6094","timestamp":"2025-12-11T19:35:21.730Z"},{"error":"AxiosError: Request failed with status code 403\n    at Kj (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:187:1137)\n    at Unzip.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:188:9852)\n    at Unzip.emit (node:events:519:35)\n    at Unzip.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1696:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at XKA.request (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:190:2130)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async r50 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3013:4507)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3013:6094","timestamp":"2025-12-11T19:35:36.044Z"},{"error":"AxiosError: Request failed with status code 403\n    at Kj (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:187:1137)\n    at Unzip.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:188:9852)\n    at Unzip.emit (node:events:519:35)\n    at Unzip.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1696:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at XKA.request (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:190:2130)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async R35 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3009:460)\n    at async Promise.all (index 0)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2995:6954","timestamp":"2025-12-11T19:38:51.251Z"}]

mairaj-syed avatar Dec 11 '25 19:12 mairaj-syed

any update on this?

GarrettBeatty avatar Jan 09 '26 02:01 GarrettBeatty

Logging in again solved this for me.

compilerbauer avatar Jan 09 '26 17:01 compilerbauer

Logging in again solved this for me.

thanks this fixed the issue for me too

GarrettBeatty avatar Jan 09 '26 17:01 GarrettBeatty

Related: OAuth → Subscription Linking Bug (hasExtraUsageEnabled: false)

This OAuth scope issue is part of a broader problem affecting Max subscribers since January 2026.

Environment

  • Claude Code: 2.1.27 (CLI)
    • OS: Ubuntu 25.10 (Linux)
      • Subscription: Claude Max (active)

The Broader Problem

The OAuth authentication pipeline is failing to properly link tokens to Max subscriptions:

  1. Token generation succeeds ✓
    1. Scope/permissions may be incorrect (this issue) ✗
    1. Subscription verification fails or returns incorrect data ✗
    1. hasExtraUsageEnabled: false in ~/.claude.json ✗
    1. Requests silently rejected → "0 tokens"

Workaround

rm -f ~/.claude.json
rm -rf ~/.claude
claude  # Re-authenticate

Note: This fixes the "0 tokens" symptom, but hasExtraUsageEnabled: false may persist - that's a backend bug.

Verify the Bug

cat ~/.claude.json | grep -E "(subscriptionType|hasExtraUsageEnabled|rateLimitTier)"

Related Issues

  • #17966 - Main bug report (hasExtraUsageEnabled stuck at false)
    • #6008 - "0 tokens" symptom
      • #20756 - OAuth in WSL2
        • #11985 - OAuth token missing user:profile scope This is a systemic backend issue that Anthropic needs to address.

ghcreative869 avatar Jan 31 '26 18:01 ghcreative869

I found the root cause is an auto-update symlink bug, not just authentication.

What happens:

  1. You downgrade to a working version (e.g., 2.1.7)
  2. On startup, even with autoUpdates: false, the binary detects 2.1.27 is already installed
  3. It updates the symlink to point to 2.1.27 anyway
  4. Next invocation uses the broken 2.1.27

Evidence from debug logs:

2026-01-31T19:30:40.208Z [DEBUG] Version 2.1.27 already installed, updating symlink

This happens at the END of a successful 2.1.7 startup - all MCP servers connect, plugins load, then it switches the symlink.

Workaround that actually works:

# 1. Downgrade
claude update --version 2.1.7

# 2. Disable auto-updates (doesn't fully work but do it anyway)
# Manually edit ~/.claude.json:
# "autoUpdates": false, "autoUpdatesProtectedForNative": false

# 3. Create shell alias to BYPASS the symlink entirely
echo 'alias claude="$HOME/.local/share/claude/versions/2.1.7"' >> ~/.zshrc
source ~/.zshrc

The alias has higher precedence than PATH, so it directly invokes the working binary and bypasses the symlink that keeps getting updated to 2.1.27.

The bug: autoUpdates: false only prevents downloading new versions, not symlinking to already-installed ones.

bhavenmurji avatar Jan 31 '26 21:01 bhavenmurji

Logout/login doesn't help me. It seems I granted all necessary scopes.

Image

aprudnikoff avatar Feb 16 '26 08:02 aprudnikoff

This was fixed in Claude Code 2.1.323, so we're closing this issue. If you disagree, let us know here and we can re-open it. Thanks for reporting!

bpasero-ant avatar Nov 29 '26 17:11 bpasero-ant