Claude Code in Practice / Start here

Sign in, and what leaves your computer

Lesson 3 of 34. Open to read. No account needed.

Claude Code runs on your computer, but Claude does not: every request goes to Anthropic over the network, together with what Claude needs to answer it. Before you send anything, you should know which account pays for it, which terms apply to your data, and what stays on your machine.

In this lesson you sign in, get the practice repository, set up its Python environment and open your first Claude Code session in it, without sending a single request to Claude yet.

By the end you can:

  • sign in and confirm which account and login method Claude Code is using;
  • explain why a stray API key in your environment can change who is billed;
  • explain what Claude Code sends to Anthropic, which data terms apply to your account, and which controls you have;
  • prepare the practice repository and trust its folder.

Before you start

  • Claude Code is installed and claude doctor looks healthy (Install and verify Claude Code).
  • You have an eligible account: a Claude Pro, Max, Team or Enterprise subscription, or a Claude Console account with API billing. The free Claude plan does not include Claude Code.
  • Git and Python 3.12 or later are installed.

Work in a terminal: on Windows, in WSL2.

Which account Claude Code uses

Account types

AccountHow you sign inWho pays
Claude Pro or MaxYour claude.ai login, in the browserYour subscription, within its usage limits
Claude Team or EnterpriseThe claude.ai account your administrator invited you toYour organisation
Claude ConsoleYour Console login, or an API keyPay-as-you-go API billing on that Console account
Cloud provider (Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry)Environment variables your organisation providesYour organisation's cloud account; not covered in this course

When several credentials are present

Claude Code can find more than one credential on a computer, and it uses them in a fixed order. In outline, highest first:

  1. Cloud provider settings, if one is switched on.
  2. The ANTHROPIC_AUTH_TOKEN environment variable (used with gateways and proxies).
  3. The ANTHROPIC_API_KEY environment variable.
  4. An apiKeyHelper command in a settings file.
  5. The CLAUDE_CODE_OAUTH_TOKEN environment variable, a long-lived subscription token for scripts.
  6. Profile credentials used by other Anthropic tools, when you name one.
  7. Your browser sign-in from /login or claude auth login.

The consequence: if ANTHROPIC_API_KEY is set in your shell, for example from another project, it outranks your subscription sign-in. In an interactive session Claude Code asks once whether to use the key; if you approve, your usage is billed to that API key's Console account, not your subscription. Check before you start:

printenv ANTHROPIC_API_KEY > /dev/null && echo "ANTHROPIC_API_KEY is set" || echo "ANTHROPIC_API_KEY is not set"

This prints whether the variable exists without printing its value. Never paste an API key into a lesson exercise, a prompt or a shared file.

What leaves your computer

Claude Code itself runs locally. To get Claude's help it sends data to Anthropic, encrypted in transit:

  • your prompts and Claude's responses;
  • anything Claude reads to answer: the contents of files it opens, the output of commands it runs, and files you attach with @;
  • operational telemetry, unless you turn it off: usage metrics, which do not include your code, prompts or file paths, and, for some accounts, error reports with known secrets and personal details redacted.

So a secret in a file Claude reads, or in a command's output, is sent with the request. The course's practice repository has a deliberately fake secrets file so that later lessons can show you how to keep such files out of reach.

Which data terms apply

Account typeUsed to train Anthropic's models?How long Anthropic keeps Claude Code data
Consumer: Free, Pro, MaxOnly if your data-use setting allows it5 years if you allow use for model improvement; 30 days if not
Commercial: Team, Enterprise, APINo, unless your organisation opts in to a programme for it30 days as standard

On a consumer plan you choose the data-use setting yourself, in your Claude privacy settings at claude.ai/settings/data-privacy-controls, and you can change it at any time. On a commercial plan your organisation's agreement applies. Anthropic's usage policy applies to every account.

What stays on your computer, and the controls you have

ItemWhere and how longYour control
Session transcripts (used to resume sessions)Stored locally, in plain text, under ~/.claude/projects/, for 30 days by defaultThe cleanupPeriodDays setting changes the period; anyone with access to your account can read them
Feedback you choose to send (/feedback, /bug)Sends a copy of the conversation, including code, to Anthropic; kept for 5 yearsOnly sent when you choose to
Usage metricsSent to Anthropic and third-party logging servicesDISABLE_TELEMETRY=1 turns them off
All non-essential trafficTelemetry, error reports, surveysCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 turns them all off

These are facts about the product on the date the course was checked; Anthropic's data-usage page is the current authority.

Sign in and prepare the practice repository

1. Check the current state

claude auth status --text

If you are not signed in, Claude Code says so and the command exits with status 1. Also run the printenv check above.

2. Sign in

claude auth login

Claude Code opens your browser at Anthropic's sign-in page. Sign in with the account you will use for the course and approve the request. If the browser does not open, the command prints the sign-in link: copy it into your browser yourself.

In WSL2, over SSH or in a container, the browser often cannot return to Claude Code. Instead, the page shows a code. Copy it, return to the terminal, paste it at the Paste code here if prompted prompt and press Enter. When sign-in completes, the terminal shows Login successful.

3. Confirm the account

claude auth status --text

Illustrative output, with personal details replaced:

Login method: Claude Max account     <- the account type in use
Organization: <your organisation>
Email: <your email>

The exit status is now 0. Note the login method line only: it tells you which kind of account pays for your exercises. Do not copy your email or organisation into notes or screenshots you share.

4. Get the practice repository

Choose a folder for the course, separate from your real work. These commands create ~/claude-code-course and clone the practice repository into it:

mkdir -p ~/claude-code-course && cd ~/claude-code-course
git clone https://github.com/vectametric/tidewell-bike-hire.git
cd tidewell-bike-hire

From now on, "the practice repository's root folder" means ~/claude-code-course/tidewell-bike-hire.

5. Create the course's Python environment

In the practice repository's root folder, create a virtual environment named .venv, activate it and install the pinned test runner:

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install pytest==9.1.1

This is "the course's Python environment" that later lessons refer to. Activation lasts for the current terminal only: in each new terminal, run source .venv/bin/activate again from the root folder before using python3. The repository's .gitignore already excludes .venv/, so it never appears in git status.

Now run the tests:

python3 -m pytest -q

Illustrative output:

FAILED tests/test_pricing.py::test_first_hour_free - AssertionError: assert 2000 == 1000
1 failed, 9 passed in 0.02s

One failure is expected: test_first_hour_free fails on purpose, and you fix it in Requests Claude can verify. Any other result means your copy differs from the course's: see When your result differs.

6. Open your first session and trust the folder

In the root folder:

claude

The very first interactive start shows two setup screens: a choice of text style for your terminal (any choice is fine; /theme changes it later), and a short set of security notes, which say that Claude can make mistakes, that you are responsible for reviewing its actions, and that prompt injection makes untrusted code risky. Press Enter to continue past each.

Then, the first time you start Claude Code in any folder, it shows a workspace trust dialog: "Quick safety check: Is this a project you created or one you trust?" A trusted folder's project settings, permission rules and hooks take full effect; until then, Claude Code holds some of them back. You wrote nothing in this repository and it is the course's own, so trust it.

The highlighted choice is No, exit. Pressing Enter straight away closes Claude Code. Press the Down arrow to highlight Yes, I trust this folder, then press Enter. In a later lesson you will see exactly what an untrusted folder holds back, and why you should read a repository's configuration before trusting it.

Then type this command at the prompt and press Enter:

/status

/status opens a panel with Claude Code's version, the folder, your login method, organisation and email, the model and the settings sources in use. It is a local command: it does not send a prompt to Claude. Check that the login method matches step 3, then press Esc to close the panel and leave:

/exit

What success shows

  • claude auth status --text exits 0 and shows the login method you intended;
  • the practice repository is cloned, its tests show exactly one expected failure, and git status --short prints nothing;
  • the folder has been trusted, and /status shows the same account.

These show that your exercises will run on the account you chose, in the course's repository, with nothing changed yet. You have spent no usage.

When your result differs

What you seeWhat it meansSafe next step
The browser does not openClaude Code cannot launch it from this terminalCopy the link the command printed into your browser
The browser shows a code instead of returningThe browser cannot reach Claude Code (common in WSL2, SSH, containers)Paste the code at the Paste code here if prompted prompt
The login method is not the account you meantAnother credential outranks your sign-in, or you signed in with another accountCheck printenv as above; /logout in a session, or sign in again with the right account
Claude Code asks whether to use an API key you did not expectANTHROPIC_API_KEY is set in your environmentDecline if you meant to use your subscription; remove the variable from your shell setup
Sign-in fails for a free plan accountThe free plan does not include Claude CodeUse an eligible plan or a Console account
git clone failsNetwork, proxy or typing problemCheck the URL; git clone again into an empty folder
Claude Code exits as soon as you press Enter on the trust dialogNo, exit was highlightedStart claude again; press Down to choose Yes, I trust this folder, then Enter
More or fewer test failures than oneYour copy or environment differsgit status; make sure .venv is active (which python3 should end in .venv/bin/python3); clone again into a new folder if needed
No module named pytestThe environment is not active in this terminalsource .venv/bin/activate from the root folder

Your turn

  1. A colleague signed in with their Pro subscription last week. Today their usage appears on their employer's Console account. Their shell profile sets ANTHROPIC_API_KEY for another project. Explain what happened, and what they should check.
  2. Put these in the order Claude Code prefers them, highest first: browser sign-in, ANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_AUTH_TOKEN.

Hint

Look again at the credential order, and at what Claude Code asks in an interactive session when it finds an API key.

Solution

  1. The API key outranks the browser sign-in. Claude Code asked whether to use it, and the colleague approved, so usage went to the key's Console account. They should run claude auth status --text and check the login method, and remove the variable from their profile (or unset it before starting Claude Code) if they want to use their subscription.
  2. ANTHROPIC_AUTH_TOKEN, then ANTHROPIC_API_KEY, then CLAUDE_CODE_OAUTH_TOKEN, then the browser sign-in.

Reset and cleanup

Keep the sign-in, the practice repository, its .venv and the trusted folder: the rest of the course uses them. To sign out at any time, run /logout in a session; the next start asks you to sign in again. If you ever need a fresh copy of the repository, clone it into a new folder rather than deleting files by hand.

Check your understanding

True or false? Explain each.

  1. Claude Code runs locally, so the contents of files Claude reads stay on your computer.
  2. On a Pro or Max plan, Anthropic always trains on your Claude Code conversations.
  3. Running /status sends a request to Claude and uses your allowance.
  4. Session transcripts are kept on your computer, in plain text, for 30 days by default.

Answers

  1. False. To answer, Claude receives what it reads: file contents and command output travel to Anthropic with the request.
  2. False. On consumer plans it depends on your data-use setting, which you control; on commercial plans Anthropic does not train on your data unless your organisation opts in.
  3. False. /status is a local command that reports version, model, account and connectivity.
  4. True. They live under ~/.claude/projects/; cleanupPeriodDays changes the period.

29 more lessons in the full course

Course access opens every lesson and adds revision notes, the Quick Reference, saved progress, bookmarks and your own notes.

INR 199 plus 18% GST. 90 days of online access. No auto-renewal.

Get the full course

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy