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.
| Prerequisite | Minimum Version | Verification Command | Expected Result |
|---|---|---|---|
| Node.js | 18.0.0 (recommended: 22 LTS) | node --version | v22.x.x |
| npm | 9.0.0+ | npm --version | 9.x.x or higher |
| Git | 2.30+ | git --version | git version 2.x |
| System | macOS 12+, Ubuntu 20.04+, Windows + WSL2 | uname -a | Darwin / Linux |
| RAM | 4 GB minimum | free -h (Linux) | >= 4 GB available |
| Disk space | 500 MB free | df -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
| Method | Command | Advantage | Disadvantage |
|---|---|---|---|
| npm global | npm install -g @anthropic-ai/claude-code | Accessible everywhere | Requires global permissions |
| npx (no install) | npx @anthropic-ai/claude-code | No installation | Slower startup |
| Update | npm update -g @anthropic-ai/claude-code | Latest version | - |
| Uninstall | npm uninstall -g @anthropic-ai/claude-code | Complete 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:
- Run
claudein your terminal - The browser opens to the Anthropic login page
- Sign in with your Anthropic account (email or Google SSO)
- Authorize access for Claude Code
- The terminal confirms authentication with a success message
- Your token is stored locally in
~/.claude/
| Auth Command | Description | Usage |
|---|---|---|
claude | Interactive authentication | First launch |
claude auth login | Force a reconnection | Expired token |
claude auth logout | Remove local token | Account switch |
claude auth status | Check connection status | Diagnostics |
claude --api-key KEY | Use a direct API key | CI/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.
| Command | Description | Example |
|---|---|---|
claude | Launch Claude Code in interactive mode | claude |
claude "prompt" | Send a single prompt | claude "explain this file" |
claude --print | Non-interactive mode (stdout output) | claude --print "list the TODOs" |
claude --model | Choose the model | claude --model claude-sonnet-4-6 |
claude --verbose | Enable detailed logs | claude --verbose |
claude config | Manage configuration | claude config set theme dark |
claude update | Update Claude Code | claude update |
claude mcp | Manage MCP servers | claude 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.
| Action | Example Prompt | Result |
|---|---|---|
| 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.
| Shortcut | Action | Context |
|---|---|---|
Enter | Send message | Single line |
Shift + Enter | New line (without sending) | Multi-line message |
Ctrl + C | Cancel current generation | During a response |
Ctrl + D | Quit Claude Code | End of session |
Ctrl + L | Clear terminal screen | Visual cleanup |
Tab | Path autocompletion | File reference |
Up / Down | Navigate prompt history | Reuse a prompt |
Escape | Cancel current edit | Edit mode |
Escape (2x) | Return to normal mode | From a submenu |
You can also use slash commands directly in the session to control behavior:
| Slash Command | Action | Description |
|---|---|---|
/help | Display help | Command list |
/clear | Reset context | New conversation |
/compact | Compress context | Free up tokens |
/model | Switch model | Switch from Opus to Sonnet |
/cost | View consumption | Tokens and estimated cost |
/permissions | Manage permissions | File 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
| Setting | Default Value | Recommendation | Command |
|---|---|---|---|
| Model | claude-sonnet-4-6 | Sonnet for daily use, Opus for complex tasks | claude config set model |
| Permissions | Ask each time | Auto-approve reads | claude config set autoApprove read |
| Theme | System | Per preference | claude config set theme dark |
| Language | English | French if desired | Interface 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.
- Create your CLAUDE.md file with
/initto anchor the project context - Explore slash commands with
/helpto discover advanced features - Test multi-file mode by requesting a refactoring across 2-3 files
- Configure MCP servers to connect external tools (databases, APIs)
- Automate with
--printmode 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.
Claude Code Training
Master Claude Code with our expert instructors. Practical, hands-on training directly applicable to your projects.
View program