Claude Code Cheat Sheet – Commands, Shortcuts and Configuration
Claude Code is Anthropic’s AI-powered coding assistant that lives right in your terminal. No more tedious copy and paste between browser and IDE: you describe what you need, and Claude implements it across multiple files, with access to your entire codebase. I use it every day, and in this cheat sheet I have collected the commands, shortcuts and configuration options that make my daily work easier. If you are completely new to AI-assisted development, my beginner’s guide to vibe coding is a gentler starting point.
Installation
Installation is quick and painless. Depending on your operating system, you have several options.
# macOS / Linux / WSL: native installer (recommended, includes auto-updates)
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
# macOS: via Homebrew (no auto-update, upgrade manually with brew upgrade)
brew install --cask claude-code
# Windows: via WinGet (no auto-update, upgrade manually with winget upgrade)
winget install Anthropic.ClaudeCode
After the installation, simply change into your project directory and start Claude Code. On first launch you will be asked to sign in.
# Change into your project and start Claude
cd your-project
claude
The Essential CLI Commands
Claude Code ships with a whole range of commands you can use straight from your terminal. These are the ones I reach for most often. One note before you dive in: some of the example prompts below are in German, exactly as they appear in my own sessions. Claude understands prompts in any language, so you can phrase yours in English and everything works the same way.
Starting and Resuming Sessions
# Start an interactive session
claude
# Start a session with an initial prompt
claude "erkläre mir dieses Projekt"
# Non-interactive mode: print the answer and exit
claude -p "erkläre diese Funktion"
# Continue the most recent conversation in the current directory
claude -c
# Resume a specific session by name
claude -r "auth-refactor" "Mach den PR fertig"
# Name the session at launch (makes it easier to find again)
claude -n "feature-login"
Piping and Automation
Claude Code follows the Unix philosophy. You can pipe data into it, use it in CI/CD pipelines or chain it with other tools.
# Analyze log output
tail -200 app.log | claude -p "Fasse Anomalien zusammen"
# Process the content of a file
cat build-error.txt | claude -p "Erkläre die Ursache dieses Build-Fehlers"
# Check changed files for security issues
git diff main --name-only | claude -p "Prüfe diese Dateien auf Sicherheitsprobleme"
# Control the output format (text, json, stream-json)
claude -p "analysiere den Code" --output-format json
Model and Updates
Claude Code gives you access to the full current model palette. Sonnet 5 (claude-sonnet-5) has been the default since 30 June 2026 and pairs strong coding skills with a one-million-token context window. Opus 4.8 (claude-opus-4-8) is built for complex agentic coding, Fable 5 (claude-fable-5) is the strongest model for long-running agents, and Haiku 4.5 (claude-haiku-4-5) is the fastest and cheapest of the family.
# Update Claude Code
claude update
# Pin the model for the session
claude --model claude-sonnet-5 # Sonnet 5: default in Claude Code, 1M context
claude --model claude-opus-4-8 # Opus 4.8: complex agentic coding
claude --model claude-fable-5 # Fable 5: strongest model for long-running agents
claude --model claude-haiku-4-5 # Haiku 4.5: fastest and cheapest
# Sign-in and status
claude auth login # Sign in
claude auth login --console # Via the Anthropic Console (API billing)
claude auth status # Check your authentication status
claude auth logout # Sign out
Keyboard Shortcuts in Interactive Mode
Once you are inside an interactive session, a number of shortcuts speed up the workflow considerably. Here are the most important ones at a glance.
General Controls
# General controls
Ctrl+C # Cancel the current input or generation
Ctrl+D # Exit the Claude Code session
Ctrl+L # Clear the terminal screen (the conversation is preserved)
Ctrl+O # Toggle verbose output (shows detailed tool usage)
Ctrl+R # Reverse search through the command history
Ctrl+T # Show or hide the task list
Ctrl+B # Move running tasks to the background
# Multiline input
\ + Enter # Works in every terminal
Shift+Enter # Works in iTerm2, WezTerm, Ghostty, Kitty
Ctrl+J # Line-feed character for multiline input
Switching Modes
# Cycle the permission mode (Default → Accept Edits → Plan → ...)
Shift+Tab
# Switch the model (without clearing your prompt)
Alt+P # Windows/Linux
Option+P # macOS
# Toggle extended thinking on or off
Alt+T # Windows/Linux
Option+T # macOS
# Toggle fast mode
Alt+O # Windows/Linux
Option+O # macOS
# Rewind or summarize past messages
Esc + Esc
Images and the Clipboard
# Paste an image from the clipboard
Ctrl+V # Standard
Cmd+V # iTerm2 on macOS
Alt+V # Windows
Slash Commands Inside the Session
Within a running session, a / at the start of the line gives you access to a whole set of commands. Simply type / and you will see a list of everything that is available.
# Essential slash commands
/init # Generate a CLAUDE.md automatically
/memory # Manage auto memory and CLAUDE.md files
/resume # Open the session picker to resume old sessions
/rename # Rename the current session
/compact # Compact the conversation (saves context tokens)
/clear # Clear the conversation history and start fresh
/vim # Enable vim editing mode
/effort # Set the effort level (low, medium, high, xhigh, max)
/model # Switch the model
/config # Configure settings
/agents # List or create available subagents
/hooks # Manage hooks
/theme # Adjust the color scheme
/terminal-setup # Configure your terminal for shortcuts
# Quick commands without a slash
! npm test # Run a bash command directly (the output is added to the context)
@src/utils.js # Reference a file and load its content into the conversation
/btw was war nochmal... # Ask a quick side question without affecting the main conversation
CLAUDE.md: Your Project Memory
The CLAUDE.md file is the heart of project customization. It lives in the root of your project, and Claude reads it at the start of every session. This is where you define the coding standards, architecture decisions and workflows that Claude should respect. I go into much more depth in my CLAUDE.md guide; here is the condensed version.
Locations and Scopes
# Project level (shared with your team via Git)
./CLAUDE.md
# or
./.claude/CLAUDE.md
# Personal level (applies to all of your projects)
~/.claude/CLAUDE.md
# Organization level (managed by IT/DevOps)
# macOS: /Library/Application Support/ClaudeCode/CLAUDE.md
# Linux: /etc/claude-code/CLAUDE.md
# Windows: C:\Program Files\ClaudeCode\CLAUDE.md
# Generate a CLAUDE.md automatically
# (Claude analyzes your codebase and creates a starter file)
/init
Tips for a Good CLAUDE.md
# Example CLAUDE.md
## Build & Test
- Build: `npm run build`
- Tests: `npm test`
- Single test: `npm test -- --grep "test name"`
## Code standards
- TypeScript with 2-space indentation
- Functional components with React hooks
- API handlers live in src/api/handlers/
## Git workflow
- Create feature branches from main
- Commit messages in English, Conventional Commits format
- Run npm test before every commit
## Architecture
- Monorepo with Turborepo
- Shared packages in packages/
- Apps in apps/
## Import external files
@README.md
@docs/git-instructions.md
Keep your CLAUDE.md under 200 lines. The more specific and concise your instructions are, the more reliably Claude follows them. If you need more than that, use the .claude/rules/ directory structure to split your rules into modules.
Path-Specific Rules
# File: .claude/rules/api-standards.md
# These rules only apply to files that match the path pattern
---
paths:
- "src/api/**/*.ts"
---
# API development rules
- Every endpoint needs input validation
- Use the standard error response format
- Add OpenAPI documentation comments
Auto Memory
Alongside the CLAUDE.md there is auto memory. Claude automatically writes notes for itself based on your corrections and preferences. This happens in the background, and you do not have to do anything. The notes are stored under ~/.claude/projects/<project>/memory/ and loaded at the start of every new session.
# Manage auto memory
/memory # Opens the memory manager
# Disable auto memory (if you prefer)
# In your project settings:
{
"autoMemoryEnabled": false
}
# Or via an environment variable:
export CLAUDE_CODE_DISABLE_AUTO_MEMORY=1
Permission Modes
By default, Claude Code asks for permission before every action. That is safe, but it can get tedious. Permission modes let you control how much autonomy Claude gets. You cycle through the modes with Shift+Tab, or you start directly in a specific mode.
# Default mode: asks before every action
claude
# Accept Edits: file changes are accepted automatically
# (you only confirm shell commands)
# Plan Mode: read-only, no changes
# (perfect for analyzing and planning)
claude --permission-mode plan
# Auto Mode: Claude works largely autonomously
claude --enable-auto-mode
# Set the permission mode at launch
claude --permission-mode plan
claude --permission-mode auto
# Always allow specific tools (no prompts)
claude --allowedTools "Bash(git log *)" "Bash(git diff *)" "Read"
# Skip all permissions (CI/CD only, not recommended for daily work!)
claude --dangerously-skip-permissions
Git Worktrees: Working in Parallel
If you want to work on several tasks at the same time, Git worktrees are your friend. Every Claude session gets its own copy of the codebase, so nothing gets in anything else’s way.
# Create a new worktree and start Claude inside it
claude --worktree feature-auth
# Another worktree for a different task
claude --worktree bugfix-123
# Worktree with an automatically generated name
claude --worktree
# Worktree with a tmux session (for several parallel terminals)
claude -w feature-auth --tmux
When you leave a worktree, Claude cleans up automatically: unchanged worktrees are deleted, and if there are changes you are asked whether you want to keep the worktree.
Hooks: Triggering Shell Commands Automatically
Hooks let you run shell commands before or after specific Claude actions. For example, you can run your linter automatically after every file edit, or receive a desktop notification whenever Claude is waiting for you. I walk through real-world setups in my practical guide to Claude Code hooks.
# Example: desktop notification when Claude is waiting for your input
# Add this to ~/.claude/settings.json:
{
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "notify-send 'Claude Code' 'Claude Code braucht Ihre Aufmerksamkeit'"
}
]
}
]
}
}
# Review hooks inside the session
/hooks
Useful Flags at a Glance
# Session management
claude -c # Continue the most recent conversation
claude -r "name" # Resume a specific session
claude -n "name" # Name the session
claude --from-pr 123 # Continue a session from a PR
# Model and performance
claude --model sonnet # Use a model alias (sonnet, opus, fable, haiku)
claude --effort high # Set the effort level (low, medium, high, xhigh, max)
claude --verbose # Enable verbose logging
# Customize the system prompt
claude --append-system-prompt "Verwende immer TypeScript"
claude --system-prompt-file ./custom-prompt.txt
# Configure MCP servers
claude --mcp-config ./mcp.json
# Additional working directories
claude --add-dir ../apps ../lib
# Chrome integration for web automation
claude --chrome
# Cap the budget (print mode only)
claude -p --max-budget-usd 5.00 "Analysiere das Projekt"
# Cap the number of turns (print mode only)
claude -p --max-turns 3 "Fasse zusammen"
# Bare mode: minimal, without hooks/plugins/MCP
claude --bare -p "schnelle Frage"
# Debug mode
claude --debug "api,mcp"
Practical Workflow Examples
Writing and Running Tests
# Ask Claude directly to write and run tests
claude "Schreibe Tests für das Auth-Modul, führe sie aus und behebe Fehler"
# In the interactive session:
# 1. Find untested code
finde Funktionen in src/services/ ohne Tests
# 2. Generate tests
schreibe Tests für den Notification-Service
# 3. Run the tests and fix failures
führe die neuen Tests aus und behebe Fehler
Creating Pull Requests
# Create commits
claude "Committe meine Änderungen mit einer aussagekräftigen Message"
# Create a pull request
claude "Erstelle einen PR für meine Änderungen"
# Or step by step inside the session:
fasse meine Änderungen am Auth-Modul zusammen
erstelle einen PR
ergänze die PR-Beschreibung um Sicherheitshinweise
Code Review and Analysis
# Use Claude as a linter in your npm scripts
# In package.json:
{
"scripts": {
"lint:claude": "claude -p 'Du bist ein Linter. Prüfe die Änderungen vs. main und melde Typos. Pro Issue: Dateiname und Zeile auf einer Zeile, Beschreibung auf der nächsten.'"
}
}
# Plan mode for safe, read-only code analysis
claude --permission-mode plan -p "Analysiere das Auth-System und schlage Verbesserungen vor"
Environment Variables
A few useful environment variables let you control the behavior of Claude Code without reaching for flags.
# Set the effort level globally
export CLAUDE_CODE_EFFORT_LEVEL=high
# Disable auto memory
export CLAUDE_CODE_DISABLE_AUTO_MEMORY=1
# Disable prompt suggestions
export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false
# Disable background tasks
export CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1
# Share task lists across sessions
CLAUDE_CODE_TASK_LIST_ID=mein-projekt claude
# Cap the thinking token budget
export MAX_THINKING_TOKENS=10000
Available Surfaces
Claude Code is not only at home in the terminal. There are several surfaces, and they all run on the same engine. Your CLAUDE.md files, settings and MCP servers work everywhere.
# Terminal CLI (the primary surface)
claude
# VS Code extension
# Install: search for "Claude Code" in Extensions (Ctrl+Shift+X)
# Open: Command Palette (Ctrl+Shift+P) → "Claude Code" → Open in New Tab
# JetBrains plugin (IntelliJ, PyCharm, WebStorm)
# Install via the JetBrains Marketplace
# Desktop app (standalone)
# Download at claude.ai
# Web interface (no local setup required)
# Available at claude.ai/code
# Remote control: drive a session from your phone or another device
claude --remote-control "Mein Projekt"
# Pull a web session into your local terminal
claude --teleport
Conclusion
Claude Code has become a permanent part of my development routine. The combination of a terminal-based workflow, the CLAUDE.md for project context and the different permission modes makes it extremely flexible. Plan mode in particular is worth its weight in gold when you want to understand a codebase before you change it. And with Git worktrees you can work on several tasks in parallel without sessions getting in each other’s way.
I update this cheat sheet regularly as new features land. Bookmark it as a reference and check back from time to time.
New in Claude Code (2026)
Since early 2026, a number of features have arrived that older guides do not cover yet:
- Plugins: bundle slash commands, skills, subagents, hooks and MCP servers into installable packages. Invoked namespaced as
/plugin-name:command, distributed via marketplaces. - Skills: model-invocable capabilities with their own
SKILL.mdunder.claude/skills/. They only consume context when Claude actually needs them. - Subagents: specialized sub-agents (
/agents) that take on self-contained subtasks and run in the background by default. - Output styles: adapt Claude Code for use cases beyond classic software development.
- Checkpoints & rewind: with
/rewind(or a doubleEsc) you jump back to an earlier state. - Fast mode: higher throughput and faster output (on Opus 4.8), toggled with
Option+OorAlt+O. - Workflows: deterministic orchestration of many agents;
/workflowsshows running workflows. - Claude in Chrome: browser automation straight from your session (
claude --chrome).
Further reading
- AI Glossary – key AI terms explained in plain language
- CLAUDE.md – The Ultimate Guide
- Claude Code Hooks – A Practical Guide
- Vibe Coding – A Beginner’s Guide
