Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/VineeTagarwal-code/claude-code/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through installing Claude Code, connecting it to your Anthropic account, and running a real coding task.
1

Install Claude Code

Install Claude Code globally via npm. You need Node.js 18 or later.
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
You should see output like:
1.x.x (Claude Code)
If claude is not found after installation, make sure your npm global bin directory is on your PATH. Run npm bin -g to find the directory and add it to your shell configuration.
2

Authenticate

Run claude for the first time. Claude Code launches an interactive authentication flow.
claude
You will be prompted to choose an authentication method:
  • Sign in with claude.ai — Use your claude.ai account (Pro or Max). This is the recommended option if you already have a subscription.
  • Use an API key — Enter an Anthropic API key from console.anthropic.com. This option is available if you use the API directly.
Follow the on-screen instructions to complete authentication. After signing in, Claude Code drops you into an interactive session prompt.
You can switch accounts at any time by running /login inside a session.
3

Navigate to your project

Exit the session with /exit or Ctrl+C, then navigate to a project directory. Claude Code uses the files in your working directory as context.
cd ~/projects/my-app
claude
Starting Claude Code from inside a git repository gives it access to the full project structure. It reads your files on demand as it works through your requests.
4

Make your first request

Type a task in plain English at the > prompt. Claude Code reads the relevant files, decides which tools to use, and executes the task.Example: explain a function
> Explain what the `parseConfig` function in src/config.ts does
Claude Code reads src/config.ts, locates the function, and explains it in plain language — including its inputs, outputs, and side effects.Example: fix a bug
> The login endpoint returns 500 when the email field is missing. Fix it and add a test.
Claude Code searches your codebase for the login endpoint, identifies the missing validation, edits the source file, and writes a test. It shows you a diff of every change before writing.Example: explore the codebase
> Give me an overview of how authentication works in this project
Claude Code reads your directory structure, follows imports, and gives you a high-level explanation without you having to navigate files manually.
5

Use slash commands

Type / at the prompt to see available commands. Here are the most useful ones to know first:Get help
/help
Shows all available slash commands and their descriptions.Switch models
/model
Opens an interactive model picker. Select from available Claude models. The currently active model is shown next to the command name.Initialize project memory
/init
Analyzes your codebase and generates a CLAUDE.md file at the project root. Claude Code reads this file at the start of every session, so you can record project-specific instructions — build commands, coding conventions, repo quirks — that Claude should always follow.Compact the conversation
/compact
If the session is running low on context window space, /compact summarizes earlier parts of the conversation to free up room without losing important context.Exit
/exit
Exits the session. You can also press Ctrl+C.

What happens during a session

When you submit a request, Claude Code:
  1. Reads the relevant files using FileRead, Glob, and Grep tools
  2. Plans the changes it needs to make
  3. Asks for permission before running commands or making edits (by default)
  4. Shows diffs for file changes and command output as it works
  5. Summarizes what it did at the end of the turn
Claude Code maintains the full conversation history within a session. You can refer back to earlier context, ask follow-up questions, and iterate on its output.

Next steps

Installation

See all install methods including native binaries and platform package managers.

Slash commands

Explore the full list of slash commands and what each one does.

Tools

Learn about the built-in tools Claude Code uses to work with your code.

Configuration

Configure models, permissions, environment variables, and more.