by Njengah
Ultimate collection of Claude Code tips, tricks, hacks, and workflows that you can use to master Claude Code in minutes
# Add to your Claude Code skills
git clone https://github.com/Njengah/claude-code-cheat-sheetGuides for using mcp servers skills like claude-code-cheat-sheet.
Last scanned: 4/26/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-04-26T06:11:23.202Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}No comments yet. Be the first to share your thoughts!
Top skills in this category by stars

Your complete guide to mastering Claude Code - from zero to hero in minutes!
After testing Claude Code extensively, I've developed this comprehensive cheat sheet that will take you from basic to advanced user without wasting time. Whether you're completely new to Claude Code or looking to master advanced features, this guide has you covered.
Install Claude Code, sign in, and start it from the root of the project you want Claude to work on.
curl -fsSL https://claude.ai/install.sh | bash
claude auth login
claude
irm https://claude.ai/install.ps1 | iex
claude auth login
claude
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
claude auth login
claude
# macOS
brew install --cask claude-code
# Windows
winget install Anthropic.ClaudeCode
Check your installation:
claude --version
claude auth status
Essential commands to get started
Claude Code requires an account with Claude Code access. After installing, sign in with claude auth login or start claude and follow the browser prompts.
# Recommended native install for macOS, Linux, or WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
# Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
# macOS Homebrew
brew install --cask claude-code
# Windows WinGet
winget install Anthropic.ClaudeCode
# Deprecated npm fallback
npm install -g @anthropic-ai/claude-code
# Sign in
claude auth login
# Check sign-in status
claude auth status
# Sign out
claude auth logout
# Start interactive REPL
claude
# Start with initial prompt
claude "summarize this project"
# Check version
claude --version
# Update to latest version
claude update
# Install or reinstall a specific native version
claude install stable
claude install latest
claude install 2.1.118
/help # Show help and available commands
/exit # Exit the REPL
/clear [name] # Start a fresh conversation; previous session stays resumable
/compact [instructions] # Summarize current history to free context
/context # Visualize context usage
/config # Open settings panel
/status # Show version, model, account, and connectivity
/doctor # Check Claude Code installation health
# Print mode - execute a prompt and exit
claude -p "explain this function"
# Process piped content
cat logs.txt | claude -p "explain"
# Continue most recent conversation
claude -c
# Continue in print mode
claude -c -p "Check for type errors"
# Continue the most recent session in this directory
claude --continue
# Resume by session ID or name
claude --resume abc123 "query"
claude --resume auth-refactor
# Open the session picker
claude --resume
# Name a session at startup
claude -n auth-refactor
# Rename inside an active session
/rename auth-refactor
# Branch the current conversation
/branch try-streaming-approach
# Resume a session linked to a pull request
claude --from-pr 123
Ctrl+C # Interrupt; if idle, clear input, then exit on second press
Ctrl+D # Exit Claude Code
Ctrl+O # Toggle transcript viewer
Ctrl+R # Reverse-search command history
Ctrl+T # Toggle task list
Esc # Interrupt current response or tool call
Esc Esc # Clear draft, or open rewind menu when input is empty
Shift+Tab # Cycle permission modes
Alt+P / Option+P # Switch model
Alt+T / Option+T # Toggle extended thinking
Alt+O / Option+O # Toggle fast mode
@ # File path mention autocomplete
! # Shell mode
Up/Down # Move in multiline input or navigate command history
Configuration, model, and session management
# Switch models
claude --model sonnet # Use Sonnet model
claude --model opus # Use Opus model
claude --model claude-sonnet-4-6 # Use a specific model
# Set reasoning effort for the session
claude --effort high
/effort high
# Change model inside a session
/model sonnet
# Add additional working directories
claude --add-dir ../apps ../lib
# Validate directory paths
claude --add-dir /path/to/project
# Output formats for print mode
claude -p "query" --output-format json
claude -p "query" --output-format text
claude -p "query" --output-format stream-json
# Input formatting for print mode
claude -p --input-format stream-json
# Limit agentic turns in print mode
claude -p --max-turns 3 "query"
# Verbose logging
claude --verbose
# Session cost, limits, and activity stats
/usage
/cost # Alias for /usage
/stats # Alias for /usage
Tools and permission management
# Allow specific tools without prompting
claude --allowedTools "Bash(git log:*)" "Bash(git diff:*)" "Write"
# Disallow specific tools
claude --disallowedTools "Bash(rm:*)" "Bash(sudo:*)"
# Prompt for specific tool permission
claude -p --permission-prompt-tool mcp_auth_tool "query"
# Skip all permission prompts (dangerous)
claude --dangerously-skip-permissions
/compact [instructions] # Summarize conversation with optional instructions
/clear # Reset conversation history and context
/exit # Exit the REPL
/help # Show available commands
/config # Open configuration panel
/doctor # Check installation health
/usage # Show session cost, limits, and activity stats
/ide # Manage IDE integrations
MCP and advanced integrations
# Configure MCP servers
claude --mcp
# MCP server management (via slash commands)
/mcp # Access MCP functionality
# Complex piping operations
git log --oneline | claude -p "summarize these commits"
cat error.log | claude -p "find the root cause"
ls -la | claude -p "explain this directory structure"
# JSON output for scripting
claude -p "analyze code" --output-format json
# Stream JSON for real-time processing
claude -p "large task" --output-format stream-json
# Batch processing
claude -p --max-turns 1 "quick query"
Advanced workflows and automation
# Create custom commands in .claude/commands/
# Example: .claude/commands/debug.md
/debug # Execute custom debug command
/test # Execute custom test command
/deploy # Execute custom deploy command
# Advanced tool permissions
claude --allowedTools "Bash(git:*)" "Write" "Read" \
--disallowedTools "Bash(rm:*)" "Bash(sudo:*)"
# Multiple directory access
claude --add-dir ../frontend ../backend ../shared
# Limit context for performance
claude -p --max-turns 5 "focused query"
# Clear context frequently
/clear # Use between tasks for better performance
# Compact conversations
/compact "keep only important parts"
Expert automation and custom workflows
# Complex model and tool configuration
claude --model claude-sonnet-4-6 \
--add-dir ../apps ../lib ../tools \
--allowedTools "Bash(git:*)" "Write" "Read" \
--verbose \
--output-format json
# Scripted Claude interactions
#!/bin/bash
claude -p "analyze codebase" --output-format json > analysis.json
claude -p "generate tests" --max-turns 3 --output-format text > tests.txt
# Session ID management
SESSION_ID=$(claude -p "start analysis" --output-format json | jq -r '.session_id')
claude -r "$SESSION_ID" "continue analysis"
# Multi-step automation
claude -p "analyze project structure" | \
claude -p "suggest improvements" | \
claude -p "create implementation plan"
Advanced automation patterns and multi-step processes
# Automated PR review process
#!/bin/bash
git diff HEAD~1 | claude -p "review this PR for security issues" > security_review.md
git diff