Applied Intelligence
Module 1: Introduction to ASD

Claude Code Authentication and Configuration

Subscription vs API key, CLAUDE.md introduction, basic settings

Claude Code supports two authentication paths: subscription-based login and direct API access. The choice affects billing, rate limits, and how credentials are managed.

Authentication methods

Subscription

To authenticate with a Claude Pro, Max, or Teams subscription:

claude login

This opens a browser for authentication with claude.ai credentials. Subscription users receive bundled usage the specific allocation depends on the plan tier. Max plans (5x and 20x tiers) provide substantially higher usage limits than Pro.

API Key

For pay-as-you-go billing or programmatic access, set an API key as an environment variable:

export ANTHROPIC_API_KEY="sk-ant-..."

API keys are created at console.anthropic.com. Usage is billed directly against the API account with no monthly limits beyond available credits.

Claude Code prioritizes API keys over subscriptions. If ANTHROPIC_API_KEY is set in the environment, Claude Code uses it even when logged in with a subscription and bills accordingly. To use subscription access, ensure the environment variable is unset.

Verifying authentication

The /status command displays the current authentication method and usage:

# From within a Claude Code session
/status

This confirms whether the session uses subscription or API billing, preventing unexpected charges.

Introducing CLAUDE.md

CLAUDE.md files provide persistent project context. Claude Code reads these files automatically at session start, loading project-specific instructions, conventions, and commands.

The file uses standard Markdown and typically includes:

  • Project structure and technology stack
  • Build, test, and lint commands
  • Code style conventions
  • Boundaries and restrictions

To get started:

  1. Navigate to your project directory
  2. Run /init to generate a starter CLAUDE.md
  3. Review and customize the generated content

Module 2 covers CLAUDE.md structure and best practices in detail.

On this page