[Feature]: Support `claude setup-token` for managed Claude accounts
Problem or use case
My managed Claude account in Orca asks me to log in again pretty much every day. The terminal Claude Code login on the same subscription stays valid for weeks, so it's specifically Orca's stored copy that keeps dying. Same pain as #6234, which got marked no longer reproducible, but I still hit it daily (Orca 1.4.x on macOS, Claude Code 2.1.220).
#6234 already describes the mechanism: the refresh token is single-use and rotates, and when a rotation lands somewhere Orca can't read it back from, the stored copy is dead and I'm logging in again. Syncing rotated tokens back helps, but there's always another race to lose.
Proposed solution
Claude Code has a credential that sidesteps rotation completely: claude setup-token mints a token that lasts a year (needs a Pro, Max, Team or Enterprise plan) and is consumed through the CLAUDE_CODE_OAUTH_TOKEN env var. Docs: https://code.claude.com/docs/en/authentication.md
Let a managed Claude account be backed by one of these tokens. Paste it when adding the account, or a guided option that runs claude setup-token the same way the add flow runs claude auth login today. For sessions on that account, Orca sets the env var and skips the credential copy, refresh and read-back entirely.
The docs say the token "can only make model requests", so the usage endpoint may reject it. If it does, the usage bars can show the unavailable state these rows already have and the agent itself still runs fine. Email auto-detection also won't work for token accounts, so the row would need a user-typed label.
Alternatives or additional context
- #6234 is about making the current OAuth sync survive rotation. Still worth doing, but a token account can't go stale in the first place.
- #2314 proposes more auth methods per provider and doesn't cover setup tokens, so this would slot in next to it.
- There's no documented way to list or revoke these tokens yet (anthropics/claude-code#48373); the settings copy should mention that.
- I have an implementation going and can send a PR if this direction sounds good.
Related symptom report: #13165 (Discord) wants this setup-token path as the preferred escape from the frequent re-auth loop also tracked in #9582.
What is this absolute madness that this has been out for over a year and there's no way to revoke a token short of emailing Anthropic ?
+1 for this. I hit the same wall on macOS with Orca 1.4.245 (the 1.4.246 release notes don't mention token accounts either): I have an account where all I can get is a claude setup-token token, and orca account add only runs claude login, so I can't add it.
I tested how Claude Code handles this (2026-11-02, Claude Code 2.1.316):
- Account folder with no login:
CLAUDE_CONFIG_DIR=<folder> claude auth status→loggedIn: false,authMethod: none. - Same folder with
CLAUDE_CODE_OAUTH_TOKENin the environment →loggedIn: true,authMethod: oauth_token. - Without the env var, passing the token through the settings
envfield also works:claude --settings <file containing {"env":{"CLAUDE_CODE_OAUTH_TOKEN":"..."}}> -p ...replies normally.
So Orca doesn't need to touch the shell function. It could write the token into that account folder's settings (file mode 600).
Suggested approach: open PR #37017 (Anthropic-compatible endpoint accounts) already merges ANTHROPIC_AUTH_TOKEN and friends into the account folder's settings.json. A setup-token account could use the same path, just writing CLAUDE_CODE_OAUTH_TOKEN instead.
Things to keep in mind: this token only has the user:inference scope, so
/api/oauth/usagecan't report quota (reading theanthropic-ratelimit-unified-5h-utilization/-7d-utilizationheaders on a messages response could work instead),- there is no email on the account,
- Remote Control is not available.
My current workaround: a PATH wrapper that exports CLAUDE_CODE_OAUTH_TOKEN when the account folder has a token file, so it applies when the Orca shell function calls command claude.
+1. I think this is more than a convenience, and the design can reuse almost everything Orca already has, including the route #37017 takes for endpoint accounts. Anything marked "verified" below I tested on Windows 11 with Orca 1.4.262 and Claude Code 2.1.327.
Why it matters
claude setup-token is Anthropic's documented sign-in for machines where a browser login doesn't fit, and Claude Code ranks CLAUDE_CODE_OAUTH_TOKEN above /login. People who choose it already run Orca with the variable exported, and Orca gets their state wrong today: the usage panel labels a subscription sign-in "API key billing", and selecting a managed account no longer decides which account requests go to (#44112). So the gap isn't only a missing option. Orca misreports a sign-in that Claude Code supports.
A token account also removes the cause of the re-auth loop discussed in #6234, #9582 and #13165. That loop comes from single-use refresh tokens rotating where Orca can't read them back. A setup-token has no refresh token, so there is nothing to rotate and nothing for Orca to sync.
My own reason is the one-year lifetime. I use Claude on several machines, and giving each one the token as an environment variable is much simpler than a browser login on every machine.
Proposed design: a token account is an account folder with the token in its settings
Orca already models an account as a CLAUDE_CONFIG_DIR folder, and selection, the pointer file, the terminal shell function and chat launches all work by switching that folder. A token account can be the same folder with the token in its settings.json:
{ "env": { "CLAUDE_CODE_OAUTH_TOKEN": "<token>" } }
- Why the settings file works: Claude Code reads
envfrom that file itself, so the token applies howeverclaudeis launched. Verified: in an Orca terminal with a different, valid token exported, an invalid placeholder in this file made the first request fail with401 Invalid bearer token, so the folder's value beats the shell's. The docs agree: settingsenvoverrides the shell, and this variable is ignored only in project and local settings. Chat launches strip auth variables before starting Claude, but they would still pick the token up from the file (from the docs and Orca's code; I only tested terminals). - Same shape as #37017: that PR writes
ANTHROPIC_AUTH_TOKENinto the account folder'ssettings.json, stores it in plain text with owner-only permissions, and skips usage polling. A token account needs the same steps withCLAUDE_CODE_OAUTH_TOKEN, and no change to selection, the pointer file or the shell function. - Adding an account: paste a token, or run
claude setup-tokenin the add-account terminal the wayclaude auth loginruns today. The label is user-typed, because the token can't read the profile, so there is no email. - No refresh: token accounts skip the credential copy, refresh and read-back entirely.
- Usage: skip
/api/oauth/usagefor token accounts. Verified: it returns 403oauth_scope_insufficient(user:profile) for a setup-token. Orca already has the right behavior for this in the "Claude usage polling: off" path (claudeUsageWithoutOAuth), which shows only the live status linerate_limitsand keeps them until their windows reset. Token accounts can take that path automatically; today the default polling-on path replaces live values with the failing poll after 5 minutes, so the bar flickers (#44112). Chats can addrate_limit_event(#35497). Only the 5-hour and weekly (all models) windows exist for this sign-in. Claude Code's own/usagesays "Other limits and usage credits aren't shown for this sign-in", so the Fable row stays hidden. - Expiry: the token lasts a year and can't be inspected, so Orca can record when it was added and remind the user before the year is up.
I can test a build or PR on Windows.
is there any update regarding this feature?