Cheatsheet10 min read

Installation and First Launch - Cheatsheet

SFEIR Institute

TL;DR

This cheatsheet gathers all the commands and shortcuts to install Claude Code, authenticate, and explore a codebase in minutes. Keep this practical reference at hand to configure your environment without friction and launch your first AI-assisted development sessions.

This cheatsheet gathers all the commands and shortcuts to install Claude Code, authenticate, and explore a codebase in minutes. Keep this practical reference at hand to configure your environment without friction and launch your first AI-assisted development sessions.

Claude Code is a command-line development agent created by Anthropic that integrates directly into your terminal to analyze, modify, and generate code. Installation and first launch of Claude Code requires Node.js 18+, Git, and an active Anthropic account. This installation and first launch cheatsheet serves as a quick reference covering essential commands, from setup to navigating your project.

Claude Code runs on macOS, Linux, and Windows via WSL2. The average installation time is 3 to 5 minutes on a standard connection.

What are the system prerequisites for installing Claude Code?

Before any installation, verify that your machine has the required tools. Check the complete installation checklist to make sure nothing is missed.

PrerequisiteMinimum VersionVerification CommandExpected Result
Node.js18.0.0 (recommended: 22 LTS)node --versionv22.x.x
npm9.0.0+npm --version9.x.x or higher
Git2.30+git --versiongit version 2.x
SystemmacOS 12+, Ubuntu 20.04+, Windows + WSL2uname -aDarwin / Linux
RAM4 GB minimumfree -h (Linux)>= 4 GB available
Disk space500 MB freedf -h>= 500 MB

Install Node.js 22 LTS if you do not have it yet:

# macOS with Homebrew
brew install node@22

# Ubuntu / Debian
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

# Verification
node --version && npm --version

In practice, 87% of installation errors come from a Node.js version below 18. Run node --version before continuing.

To resolve common issues, the installation troubleshooting guide details each error case.

Key takeaway: Node.js 18+ and Git 2.30+ are the two essential prerequisites - verify them with a single command before starting the installation.

How to install Claude Code via npm or natively?

Installation is done with a single npm command. Open your terminal and run the following command:

# Global installation (recommended)
npm install -g @anthropic-ai/claude-code

# Verify installation
claude --version
MethodCommandAdvantageDisadvantage
npm globalnpm install -g @anthropic-ai/claude-codeAccessible everywhereRequires global permissions
npx (no install)npx @anthropic-ai/claude-codeNo installationSlower startup
Updatenpm update -g @anthropic-ai/claude-codeLatest version-
Uninstallnpm uninstall -g @anthropic-ai/claude-codeComplete cleanup-

In case of permission errors on macOS or Linux, use this approach rather than sudo:

# Configure npm to avoid sudo
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH

# Then rerun the installation
npm install -g @anthropic-ai/claude-code

the Claude Code v2.1 package size is approximately 45 MB. Download takes an average of 12 seconds on a 30 Mbps connection.

For a step-by-step guide with screenshots, check the installation and first launch tutorial which covers each step in detail.

Key takeaway: a single command npm install -g @anthropic-ai/claude-code is all you need - prefer global installation for access from any directory.

How to authenticate and configure the OAuth flow?

On first launch, Claude Code triggers an OAuth authentication flow in your browser. Simply run claude in your terminal:

# First launch - opens the browser automatically
claude

# If the browser does not open, copy the displayed URL
# and paste it manually into your browser

Here is how the process works in practice:

  1. Run claude in your terminal
  2. The browser opens to the Anthropic login page
  3. Sign in with your Anthropic account (email or Google SSO)
  4. Authorize access for Claude Code
  5. The terminal confirms authentication with a success message
  6. Your token is stored locally in ~/.claude/
Auth CommandDescriptionUsage
claudeInteractive authenticationFirst launch
claude auth loginForce a reconnectionExpired token
claude auth logoutRemove local tokenAccount switch
claude auth statusCheck connection statusDiagnostics
claude --api-key KEYUse a direct API keyCI/CD, scripts

The OAuth token has a validity period of 30 days. In practice, you will only need to re-authenticate about once a month.

For CI/CD environments, use an environment variable rather than the interactive flow:

export ANTHROPIC_API_KEY="sk-ant-..."
claude --print "your prompt"

The tips for your first conversations guide explains how to get the most out of your session once authenticated.

Key takeaway: the OAuth flow is automatic on first claude - your token remains valid for 30 days, and the ANTHROPIC_API_KEY variable lets you bypass interactive authentication.

What are the essential commands for first launch?

Here are the most common commands to know from your very first launch. This table serves as your installation and first launch cheatsheet with essential commands.

CommandDescriptionExample
claudeLaunch Claude Code in interactive modeclaude
claude "prompt"Send a single promptclaude "explain this file"
claude --printNon-interactive mode (stdout output)claude --print "list the TODOs"
claude --modelChoose the modelclaude --model claude-sonnet-4-6
claude --verboseEnable detailed logsclaude --verbose
claude configManage configurationclaude config set theme dark
claude updateUpdate Claude Codeclaude update
claude mcpManage MCP serversclaude mcp list

Navigate to your project directory first, then launch Claude Code:

cd ~/my-project
claude
# Claude automatically analyzes the project structure

Initial loading time for a 10,000-file project is about 8 seconds. Projects with fewer than 1,000 files load in under 2 seconds.

The essential slash commands reference goes deeper into each command available in the interactive session. You can also check the slash commands cheatsheet for a quick overview.

Key takeaway: claude alone is enough to get started - add --print for scripting and --verbose to diagnose a problem.

How to explore and understand your codebase with Claude Code?

Once in an interactive session, Claude Code automatically analyzes your codebase. Ask your questions in natural language to navigate the code.

ActionExample PromptResult
Overview"Describe the architecture of this project"Structure, frameworks, dependencies
Find a file"Where is the Header component defined?"File path and contents
Understand a function"Explain the processOrder function"Line-by-line explanation
Find a bug"Why is this test failing?"Analysis and fix suggestion
Analyze dependencies"List all npm dependencies"Parsed package.json
Summarize changes"What does the latest commit contain?"Commented diff

In practice, Claude Code reads files on demand. It does not index the entire codebase at startup: it explores contextually based on your questions.

Internal slash commands enhance exploration. Use /init to create a CLAUDE.md file that stores your project context:

# In the interactive Claude Code session
> /init
# Generates a CLAUDE.md with the detected architecture

The CLAUDE.md memory system lets you permanently customize Claude Code's behavior on your project. The more precise your CLAUDE.md, the more relevant the responses.

In practice, a well-maintained CLAUDE.md file reduces token consumption per session by 40% according to community feedback in 2026.

Key takeaway: ask your questions in natural language, and use /init to create a CLAUDE.md file that remembers your project context between sessions.

Which keyboard shortcuts should you master for efficient navigation?

Keyboard shortcuts speed up your workflow in the interactive Claude Code session. Memorize these combinations to boost your productivity.

ShortcutActionContext
EnterSend messageSingle line
Shift + EnterNew line (without sending)Multi-line message
Ctrl + CCancel current generationDuring a response
Ctrl + DQuit Claude CodeEnd of session
Ctrl + LClear terminal screenVisual cleanup
TabPath autocompletionFile reference
Up / DownNavigate prompt historyReuse a prompt
EscapeCancel current editEdit mode
Escape (2x)Return to normal modeFrom a submenu

You can also use slash commands directly in the session to control behavior:

Slash CommandActionDescription
/helpDisplay helpCommand list
/clearReset contextNew conversation
/compactCompress contextFree up tokens
/modelSwitch modelSwitch from Opus to Sonnet
/costView consumptionTokens and estimated cost
/permissionsManage permissionsFile read/write

In practice, the /compact command reduces context by 60 to 70%, allowing you to continue a long session without losing coherence.

The permissions and security cheatsheet details how to configure file permissions. Also check the essential slash commands tips for advanced usage.

Key takeaway: Ctrl + C to cancel, Ctrl + D to quit, /compact to free context - these three shortcuts cover 80% of navigation needs.

Should you configure advanced settings from the first launch?

Some settings are worth adjusting from the very first session to optimize your experience. Configure at minimum the default model and file permissions.

# Choose the default model
claude config set model claude-sonnet-4-6

# Enable verbose mode for debugging
claude config set verbose true

# Set the default working directory
claude config set workdir ~/projects
SettingDefault ValueRecommendationCommand
Modelclaude-sonnet-4-6Sonnet for daily use, Opus for complex tasksclaude config set model
PermissionsAsk each timeAuto-approve readsclaude config set autoApprove read
ThemeSystemPer preferenceclaude config set theme dark
LanguageEnglishFrench if desiredInterface adapts to the prompt

the Claude Sonnet 4.6 model offers an optimal performance/cost ratio for 90% of daily development tasks. The Opus 4.6 model excels at complex refactoring and architecture tasks.

If you want to go deeper into configuration, the commands reference for your first conversations covers the advanced options available in the interactive session.

Key takeaway: configure the default model and read permissions from the first session - you will save time on every subsequent interaction.

How to go further after installation?

Once Claude Code is installed and configured, you can leverage the full potential of the tool. Here are the recommended next steps to progress.

  1. Create your CLAUDE.md file with /init to anchor the project context
  2. Explore slash commands with /help to discover advanced features
  3. Test multi-file mode by requesting a refactoring across 2-3 files
  4. Configure MCP servers to connect external tools (databases, APIs)
  5. Automate with --print mode in your CI/CD scripts

In practice, developers trained at SFEIR Institute report a 35% productivity gain from the first week of using Claude Code in their daily workflow.

To master Claude Code in real-world conditions, the Claude Code training from SFEIR Institute offers an intensive one-day session with hands-on labs covering installation, configuration, and advanced use cases. If you want to integrate Claude Code into a complete AI-assisted development workflow, the 2-day AI-Augmented Developer training covers all tools and methodologies.

Experienced developers can directly access the one-day AI-Augmented Developer - Advanced training to deepen prompt engineering techniques and multi-agent orchestration.

Key takeaway: installation is just the beginning - invest 15 minutes in configuring CLAUDE.md and permissions to turn Claude Code into a true development copilot.

Recommended training

Claude Code Training

Master Claude Code with our expert instructors. Practical, hands-on training directly applicable to your projects.

View program