Problem
OpenClaw's onboard wizard uses claude setup-token to authenticate with Anthropic. However, setup-token only requests the user:inference scope. Usage tracking (showing plan usage in /status) requires the user:profile scope, which is only granted by the full claude login browser OAuth flow.
This means all Claude Max/Pro users who onboard via setup-token lose usage visibility in /status. The OAuth usage endpoint returns:
HTTP 403: OAuth token does not meet scope requirement user:profile
Impact
- All users onboarded via
setup-token (the default Anthropic auth path) cannot see usage tracking
- The error message is not actionable — users don't know how to fix it
- The existing fallback to
claude.ai web session key requires a separate env var most users won't have
Root Cause
This is an upstream limitation in Claude Code CLI:
claude setup-token only requests user:inference scope
claude login (full browser OAuth) requests all scopes including user:profile
- The Anthropic OAuth usage endpoint (
/api/oauth/usage) requires user:profile
Related Claude Code issues:
Proposed Fix
-
Actionable error message: When usage tracking fails with the scope error and no web fallback is available, show a clear message: "setup-token missing user:profile scope — run \claude login` (full OAuth) to enable usage tracking"instead of the genericHTTP 403` error.
-
Post-onboard warning: After setup-token onboarding completes, display a note informing users that usage tracking requires the full OAuth flow and how to upgrade.
Workaround
Users can work around this by:
- Running
claude login on a machine with a browser (full OAuth flow)
- Using
openclaw models auth paste-token to import the resulting token
- Or setting
CLAUDE_AI_SESSION_KEY env var with a claude.ai browser session key
Problem
OpenClaw's
onboardwizard usesclaude setup-tokento authenticate with Anthropic. However,setup-tokenonly requests theuser:inferencescope. Usage tracking (showing plan usage in/status) requires theuser:profilescope, which is only granted by the fullclaude loginbrowser OAuth flow.This means all Claude Max/Pro users who onboard via
setup-tokenlose usage visibility in/status. The OAuth usage endpoint returns:Impact
setup-token(the default Anthropic auth path) cannot see usage trackingclaude.aiweb session key requires a separate env var most users won't haveRoot Cause
This is an upstream limitation in Claude Code CLI:
claude setup-tokenonly requestsuser:inferencescopeclaude login(full browser OAuth) requests all scopes includinguser:profile/api/oauth/usage) requiresuser:profileRelated Claude Code issues:
Proposed Fix
Actionable error message: When usage tracking fails with the scope error and no web fallback is available, show a clear message:
"setup-token missing user:profile scope — run \claude login` (full OAuth) to enable usage tracking"instead of the genericHTTP 403` error.Post-onboard warning: After setup-token onboarding completes, display a note informing users that usage tracking requires the full OAuth flow and how to upgrade.
Workaround
Users can work around this by:
claude loginon a machine with a browser (full OAuth flow)openclaw models auth paste-tokento import the resulting tokenCLAUDE_AI_SESSION_KEYenv var with a claude.ai browser session key