# claude auth login Command

> It signs you in from the shell. claude auth logout signs you out.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude auth login, claude auth logout, claude auth

## Think of it like

It is like you sign the book at the front desk so you can go in.

## Definition

claude auth login signs you in to your Anthropic account from the shell, with no session open. Add --console to sign in with a Console account that pays by use, not a Claude plan. Add --sso to use your company's single sign-on, or --email to fill in your address. claude auth logout signs you out.

## Example

Emma sets up a new laptop with a script. The script runs claude auth login --sso, she finishes the sign-in in the browser, and the setup goes on.

## Example code

```bash
claude auth login --console
```

Sign in with a Console account.

## Why it matters

Setup scripts can sign in as a step, the same way every time, with no chat to open.

## Common mistake

Using it in a CI job. A CI job has no browser, so it uses a token from claude setup-token instead.

## Three principles

- **From the shell.** No session.
- **Pick a way.** --console, --sso.
- **logout.** Signs you out.

## Related terms

- [/login Command](https://learn.benibix.com/term/ai/login-command)
- [claude setup-token Command](https://learn.benibix.com/term/ai/claude-setup-token-command)
- [claude auth status Command](https://learn.benibix.com/term/ai/claude-auth-status-command)
- [Claude Code Authentication](https://learn.benibix.com/term/ai/claude-code-authentication)

## Told apart from

- [claude setup-token vs claude auth login](https://learn.benibix.com/compare/claude-setup-token-command-vs-claude-auth-login-command): People think claude setup-token signs in the computer you run it on, and it does not. claude auth login signs you in here and keeps the sign-in. claude setup-token opens the browser once, then prints a token that lasts one year. It saves that token nowhere. You copy it into a CI job, or any machine with no browser.

## Taught in

- [Claude Code Login Commands](https://learn.benibix.com/learn/ai-claude-code-commands/claude-code-login-commands): Claude Code Commands, 3/17

![claude auth login signs you in on this computer. claude setup-token prints a one-year token that a CI job uses instead. claude auth status answers 0 or 1.](https://learn.benibix.com/diagrams/cli-auth.svg)

---

Source: https://learn.benibix.com/term/ai/claude-auth-login-command
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
