claude usage fails with scope error: token from setup-token lacks user:profile scope

Resolved 💬 4 comments Opened Feb 1, 2026 by iyeru Closed Feb 5, 2026

Description

Running claude usage fails with a permission_error indicating that the OAuth token does not have the required user:profile scope. However, claude setup-token only requests user:inference scope during the OAuth flow, making it impossible to resolve this through re-authentication.

Steps to Reproduce

  1. Authenticate locally via claude setup-token (completes successfully)
  2. Run claude usage
  3. Observe 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"}}

Expected Behavior

claude usage should successfully load and display usage data after authenticating with claude setup-token.

Actual Behavior

The command fails because the OAuth token lacks the user:profile scope. The token generated by setup-token only includes user:inference:

scope=user%3Ainference

What Was Investigated

  • Confirmed the error originates from the Anthropic API (standard error envelope format)
  • Inspected the OAuth authorization URL produced by claude setup-token and found it only requests user:inference scope
  • The scope mismatch (user:inference vs user:profile) exists in the CLI itself — re-running setup-token does not resolve it
  • This command was previously working, suggesting either a new scope requirement was added to the usage endpoint or the token scope was narrowed in a recent CLI update

Environment

  • Claude Code version: v2.1.29
  • Platform: Linux (WSL2)

View original on GitHub ↗

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