Which kinds of account can you sign in to Claude Code with, and what happens at first launch with each?
answer
- free plan is not on the list
- subscription seat vs Console organization
- cloud provider: no browser at all
- an exported key changes the prompt
- /status names the login method
basics
~20 sClaude Code accepts a Pro or Max subscription, a Team or Enterprise seat, a Claude Console account, or a cloud provider such as Amazon Bedrock; the free claude.ai plan is excluded. First launch opens a browser login, except for cloud providers.
solid answer
~40 sClaude Code needs a paid account: a **Pro or Max** subscription, a **Team or Enterprise** seat (both log in with a claude.ai account), a **Claude Console** account an admin invited you to, or a **cloud provider** - Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. The free claude.ai plan does not include it. On first launch `claude` opens a browser login; if the browser cannot reach the local callback (WSL2, SSH, containers) you paste the code it shows. If `ANTHROPIC_API_KEY` is already set, it asks you once to approve the key instead. Cloud providers skip the browser: you set their environment variables or pick **3rd-party platform** at the login prompt. `/status` shows which login is active, and `/logout` resets it.
go deeper
Name the accepted account types, say that the free plan is excluded, and describe the browser login, including pasting the code when the redirect fails.
Explain how an ANTHROPIC_API_KEY changes first launch into a one-time approval, and how /status tells a subscription login from an API key.
Tie the account type to billing and features: a Console key bills per token, and some features need a claude.ai login rather than a key.
Weigh Team or Enterprise seats against Console keys and a cloud provider for a rollout, by billing model, admin control and what each login unlocks.
## The account types Claude Code accepts Claude Code is not usable anonymously and not on the free claude.ai plan. It authenticates against one of five kinds of account, and the kind you pick decides **who is billed** and **which features need a claude.ai login**. | Account | How you sign in | Who pays | |---|---|---| | **Pro or Max** subscription | browser login with your claude.ai account | your subscription | | **Team or Enterprise** seat | browser login with the claude.ai account your admin invited | the organization's seats | | **Claude Console** | browser login with Console credentials, after an admin invite | per token, to the Console organization | | **Cloud provider** (Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry) | environment variables or a setup wizard; no browser | your cloud account | | **Claude apps gateway** (self-hosted) | corporate SSO through `/login` | the provider the gateway routes to | For teams the docs recommend **Claude for Teams or Enterprise**: members get Claude Code and Claude on the web with centralized billing. The **Console** route suits organizations that prefer API-based billing; admins invite users and give them either the **Claude Code** role (can only create Claude Code API keys) or the **Developer** role (can create any API key). At the `/login` prompt a Console user can either keep the browser sign-in as an Anthropic profile login, labelled recommended, or have Claude Code create a Console API key, labelled legacy. ## What the first launch does 1. You run `claude` in a terminal. 2. Claude Code opens a browser window for the login. If it does not open, press `c` to copy the login URL and paste it into a browser yourself. 3. If the browser shows a **login code** instead of redirecting back, paste it at the `Paste code here if prompted` prompt. This happens when the browser cannot reach Claude Code's local callback server, which is common in **WSL2, SSH sessions and containers**. 4. The terminal shows `Login successful` and asks you to press Enter. Two cases change this flow: - **`ANTHROPIC_API_KEY` is set** in the environment: Claude Code skips the browser and asks you once to approve or decline the key. Your choice is remembered. - **A cloud provider**: you either export its switch (`CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX` or `CLAUDE_CODE_USE_FOUNDRY`) with its credentials before running `claude`, or choose **3rd-party platform** at the login prompt, which starts an interactive wizard for Bedrock and for Google Cloud's Agent Platform. No browser login is involved. ## Checking and switching the login - **`/status`** shows the account in use. A `Login method` row such as a Claude Max account means a subscription; an `API key` row means requests go to a Console organization. - **`/logout`** signs you out and also resets first-launch setup, so the next `claude` walks you through login again. - **Two accounts side by side** (work and personal): give each its own configuration directory with `CLAUDE_CONFIG_DIR`, for example an alias `claude-work` that sets it. Each directory keeps its own settings, history and login. ## Where the credential lives - **macOS**: the encrypted Keychain. If the Keychain rejects the write, as it can when locked in an SSH session, the login falls back to `~/.claude/.credentials.json` with mode `0600`. - **Linux**: `~/.claude/.credentials.json`, mode `0600`. - **Windows**: `%USERPROFILE%\.claude\.credentials.json`, protected by the profile directory's access controls. With `CLAUDE_CONFIG_DIR` set, the file and the Keychain entry both follow that directory. ## When the login goes stale A claude.ai login does not last forever, and three situations catch people out: - **Expiry.** Within three days of expiry, Claude Code warns at startup: `Your login expires in 3 days · run /login to renew`. The warning never blocks a request. Once the login has expired and cannot be refreshed, each request fails with `Login expired · Please run /login`, and `/status` shows a `Login` row reading `Expired — log in again`. - **Unattended sessions.** A long-running session that outlives the login stops making progress until someone signs in again, so renew early before leaving work running. - **A leftover key.** An old `ANTHROPIC_API_KEY` in a shell profile that you once approved quietly replaces the subscription; `/status` is where you notice it. ## Why interviewers ask The account type is not cosmetic. It decides whether usage draws on a plan or is billed per token, and some features exist only with a claude.ai login - Remote Control, for instance, needs a Pro, Max, Team or Enterprise plan and does not accept API keys. A candidate who can say which login is active, and how to check it, will not be surprised by a bill or a missing feature.
- You need a work and a personal Claude Code login on one laptop. How do you keep both signed in?Give each account its own configuration directory with `CLAUDE_CONFIG_DIR`, for example `alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'`. Each directory keeps its own settings, session history and login, and on macOS the Keychain entry is keyed to the directory too. The first run of the alias walks you through login for that directory.
- Why might a login over SSH show a code instead of returning to the terminal on its own?The browser normally redirects back to a local callback server that Claude Code starts. Over SSH, in WSL2 or in a container the browser usually cannot reach that server, so it shows a code instead. You paste it at the `Paste code here if prompted` prompt and the login completes.
- The free claude.ai plan is enough to use Claude Code
- Cloud provider users still sign in through the claude.ai browser login
- A set ANTHROPIC_API_KEY is ignored until you log out
- /logout only clears the token and keeps first-launch setup
- Two accounts need two separate Claude Code installations