In short.
This authentication guide helps developers and administrators set up Claude Code access, but the sign-in method can change billing, available features and which organization restrictions apply. It explains browser login, Console access without an API key, cloud providers, gateways, credential storage and unattended use. Its most consequential details are credential precedence and exceptions to managed login controls. Prices, complete installation requirements and practical reliability are not established by this page.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete Authentication page at [https://code.claude.com/docs/en/authentication.md], including its inline examples, notices, credential precedence rules and version conditions. Linked installation, provider, gateway, settings, pricing and troubleshooting pages are excluded. No commands or authentication flows were executed. Provider setup, practical reliability, actual charges, security guarantees and redistribution rights remain unassessed or unknown where the page does not establish them.
The overview
Resource identity
Authentication is a Claude Code documentation page explaining how individuals, teams and organizations configure access. The resource is a technical guide at [https://code.claude.com/docs/en/authentication.md], rather than an installable tool.
Its scope includes account choices, login procedures, credential selection, organization restrictions, storage and renewal. Installation, provider configuration and several settings references are linked separately.
Practical assessment
The guide is particularly useful when Claude Code uses an unexpected account, asks for login again or behaves differently across a terminal, an automated script and a managed machine. It explains the competing credentials behind those symptoms instead of stopping at browser sign-in.
Administrators also get important limits on organization enforcement. The page is a detailed reference, but completing a cloud or gateway deployment requires additional documentation. Its recommendation of Team or Enterprise access for most teams is vendor guidance; the page supplies no comparative evaluation.
Who it helps
Individual developers can use it to understand subscription login, separate work and personal configurations, and diagnose an API key overriding their subscription. The page lists Pro, Max and Ultra subscriptions alongside invited Team and Enterprise accounts.
Team administrators can use it to compare centralized subscription access, Console API billing, cloud-provider credentials and corporate gateway sign-in. Developers maintaining unattended scripts can find token and login-expiry guidance, while enterprise administrators get details about device policies, provider restrictions and federation credentials.
What the guide explains
It documents first-launch browser login, claude auth login, /login, /logout and authentication inspection through /status. It also explains Console login without creating an API key, automatic refresh of that login, dynamic credentials through apiKeyHelper and named Anthropic profiles.
For multiple accounts, it describes using CLAUDE_CONFIG_DIR to separate settings, session history and directory-associated credentials. A significant exception is keyless Console sign-in: its profile is stored outside that directory, so separate configuration directories do not isolate two such sign-ins.
Using it
Requirements and compatibility
Readers need an installed Claude Code client and an eligible account or provider credential. Team members need an invitation. Console users must accept their invitation; the Claude Code role permits Claude Code API keys, while the Developer role permits any API key. Cloud-provider and gateway access require organization-specific configuration.
The page specifies minimum versions for several features: keyless Console sign-in requires v2.1.242, allowedProviders requires v2.1.285, and login end-date reporting requires v2.1.318. Complete operating-system requirements and the latest available Claude Code version are not established here.
How authentication is chosen
For ordinary CLI sessions, the documented priority is configured cloud-provider credentials, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, apiKeyHelper, CLAUDE_CODE_OAUTH_TOKEN, eligible profile or federation credentials, then subscription login. A signed-in Claude apps gateway session takes precedence over this list. Enterprise Admin Console configuration has a separately referenced routing mechanism.
Profile priority has exceptions. Explicitly named profiles and federation variables outrank subscription login. An active user_oauth profile ranks below a working claude.ai login, while an active federation profile ranks above it. A saved Console API key overrides profile credentials when CI is not set. Environment API keys require approval in interactive use but are always used when present in non-interactive -p mode, subject to applicable managed restrictions.
The documented storage differs by operating system: macOS uses Keychain with a file fallback for some logins; Linux uses a credentials file with mode 0600; Windows uses a file inheriting user-profile access controls. These storage descriptions do not establish independently audited security guarantees.
Setup path
The basic documented path is to install Claude Code, run claude and complete browser sign-in. If the browser does not open, pressing c copies the login URL. If the browser displays an authorization code, paste it into the terminal prompt. A prior login or an approved environment API key can bypass the initial login prompt.
For keyless Console access, unset ANTHROPIC_API_KEY and choose the Console account option at /login. That route stores an OAuth profile, creates no API key and signs out any claude.ai login stored on the machine. Availability depends on provider and policy settings.
For managed deployments, the guide directs administrators to distribute login settings through device management. Server-managed settings arrive after authentication and therefore cannot redirect the first login. Logging out also resets first-launch setup state.
Example use case
Consider a developer with a valid Claude subscription who previously approved ANTHROPIC_API_KEY. The guide explains that the API key takes priority over subscription login, so requests use the API credential and its billing route.
Its documented remedy is to run unset ANTHROPIC_API_KEY in the shell and inspect /status. Subscription access still depends on having a valid login and no other higher-priority credential or provider selection. This example follows the documentation; it was not executed.
Assessment & evidence
Important limitations
Organization restrictions have substantial exceptions. forceLoginOrgUUID checks claude.ai account logins, but does not validate the organization of saved Console credentials or profiles. The setup-token and install-github-app paths enforce only forceLoginMethod and can mint a token for another organization. In the terminal login screen, claudeai and console values preselect a method and should not be relied on to block other logins.
allowedProviders controls permitted provider routes, but a list supplied only through server-managed settings reaches only sessions that fetch those settings. The page explicitly distinguishes this convenience from enforcement through device management.
Authentication support differs across surfaces. Claude Desktop and cloud sessions do not use the CLI's ordinary environment credentials or apiKeyHelper, and cloud sessions use subscription credentials. Bare mode ignores profiles, federation variables and CLAUDE_CODE_OAUTH_TOKEN. Profile authentication lacks features requiring claude.ai login, including its connectors and /schedule.
A setup-token credential can make model requests but cannot establish Remote Control sessions or fetch claude.ai connectors; locally configured MCP servers remain available. Keyless Console login also has provider and managed-policy exclusions, so it is not a universal substitute for API keys.
How to use the guidance
The practical decision starts with billing ownership, organization requirements and needed features. Subscription login supports the claude.ai-dependent features described here; Console access supports API-based billing; cloud and gateway routes use different identity arrangements.
A reasonable implication of the documented exceptions is that having a login restriction configured does not prove every credential path belongs to the intended organization. Likewise, successful authentication alone does not identify the billing account. The guide's /status checks and path-specific explanations help readers distinguish these questions.
Authentication alternatives
Within Claude Code, the page presents Team or Enterprise subscriptions for centralized account management, Console for API billing, Amazon Bedrock, Google Cloud's Agent Platform and Microsoft Foundry for cloud-provider access, and a self-hosted Claude apps gateway for corporate single sign-on and configured provider routing.
It also distinguishes static API keys, refreshed OAuth profiles, federation credentials and subscription tokens for unattended requests. These are alternatives with different policy and feature constraints. The page does not compare other coding assistants or establish that one authentication route is cheaper or more reliable.
Evidence and its limits
The evidence is the complete Authentication documentation page at [https://code.claude.com/docs/en/authentication.md], captured on 2026-11-24 at 15:01:26.559 UTC and retained as selected-page.txt.
This is vendor documentation supporting statements about intended behavior. No commands, sign-in flows or managed configurations were executed. Runtime reliability, actual billing outcomes and security guarantees remain untested. Linked pages are outside the evidence covered here.
Access & freshness
Costs and billing implications
The page distinguishes subscription access from Console API billing and cloud-provider access, but supplies no prices, usage allowances, token rates or provider charges. Actual costs and the cheapest suitable route are unknown from this evidence.
Credential choice can affect who pays. An approved API key can override subscription login, and an expired subscription login may fall back to another saved credential billed to its organization. The one-year token generated by claude setup-token requires an eligible subscription; its duration does not establish unlimited usage.
Rights and permissions
The page does not state a documentation license or grant permission to redistribute the page or its examples. Documentation reuse rights and the Claude Code software license are unknown from this page.
Its account and role descriptions explain access permissions, including who may create API keys. They do not establish software redistribution rights, ownership terms for generated output or contractual data-handling terms.
Version sensitivity
The captured page contains several version-dependent changes without an overall last-updated date. It says earlier sign-in can skip onboarding prompts from v2.1.290, and documents login-method behavior from v2.1.212.
Gateway-only authentication requires v2.1.261, or v2.1.265 when only forceLoginGatewayUrl is set. For organizations also distributing server-managed login settings, it advises keeping the login keys in both locations until every client reaches v2.1.299. Compatibility with any particular installed client must therefore be checked; capture date alone does not establish compatibility.
Suggested next steps
Choose the account or provider that should own access and billing, then follow the matching sign-in section. Confirm the active credential and organization through /status before relying on the configuration. For cloud providers or gateways, consult the linked setup documentation because this page does not contain the full deployment procedure.
For unattended use, check whether a subscription token's feature restrictions fit the job. On v2.1.318 or later, claude auth status --text can report a subscription login's end-date range when known. Renew through /login before the earlier date; ordinary usage does not extend the login.
Administrators should examine existing credentials, the exact login paths developers use and the provider allowlist alongside organization settings. The documented exceptions make these separate configuration questions.
