An Ideas to Life experiment

๐Ÿš€ Claude Code Cheat Sheet

Your quick reference guide for AI-powered coding

Getting Started

๐Ÿš€ 5-Minute Quick Start
1. Install: brew install --cask claude-code
2. Navigate: cd your-project
3. Start: claude
4. Login: /login (first time only)
5. Ask: "what does this project do?"

That's it! You're ready to code with AI.
Installation Options
Platform Command
macOS (Homebrew) brew install --cask claude-code
npm (All platforms) npm install -g @anthropic-ai/claude-code
VS Code Extension Search "Claude" in VS Code Extensions
First Time Setup
cd /path/to/your/project
claude
/login

After login, Claude has full context of your project and is ready to help!

Your First Tasks

Try these to get comfortable:

> explain what this project does
> show me the file structure
> what's in the README?
> add a hello world function to index.js
> run the tests
Common Use Cases
  • Code understanding: "Explain how authentication works"
  • Feature development: "Add a dark mode toggle"
  • Bug fixing: "Fix the login timeout issue"
  • Refactoring: "Convert these callbacks to async/await"
  • Testing: "Write unit tests for the user service"
  • Documentation: "Update the README with API docs"

Essential Commands

Starting Claude Code
Command Description
claude Start interactive mode
claude "task" Run a one-time task
claude -p "query" Quick query, then exit
claude -c Continue most recent conversation
claude -r Resume a previous conversation
claude commit Create a Git commit
Slash Commands (Inside Claude Code)
Command Description
/help Show available commands
/clear Clear conversation history
/login Switch accounts
/resume Resume a previous session
/rename Name your current session
/stats See usage graphs and history
/tasks View running background tasks
/bug Report a bug to Anthropic
exit or Ctrl+C Exit Claude Code
? See keyboard shortcuts
Keyboard Shortcuts
Shortcut Action
Tab Command completion
โ†‘ Command history
Escape Interrupt Claude during any phase
Double Escape Jump back in history and edit previous prompt
Shift+Tab Toggle accept all mode
? Show all shortcuts

Skills - Specialized Commands

What are Skills?

Skills are specialized slash commands that give Claude superpowers for specific tasks. Think of them as expert modes - when you need to commit code, review PRs, or convert documents, skills handle the entire workflow for you.

Built-in Skills
Skill Description
/commit Create a smart Git commit with AI-generated message
/review-pr [number] Comprehensive code review of a GitHub pull request
/pdf [file] Convert and interact with PDF documents
/remember Save important context for future sessions
Using Skills
# Quick commit workflow
/commit

# Review a specific PR
/review-pr 123

# Work with PDFs
/pdf document.pdf
> summarize this document
> extract the key findings
Installing Custom Skills

Skills can be installed from npm packages or local directories:

# Install from npm
claude install @namespace/skill-name

# Install from local directory
claude install ./path/to/skill

# List installed skills
claude list-skills
๐Ÿ’ก Skill Development
You can create your own skills using the Claude Agent SDK. Skills are essentially specialized agents with predefined workflows. Check the Anthropic SDK documentation to build custom skills for your team.

Common Workflows

Understanding Your Codebase
> what does this project do?
> explain the folder structure
> what technologies does this project use?
> where is the main entry point?
Making Code Changes
> add a hello world function to the main file
> refactor the authentication module to use async/await
> add input validation to the user registration form
Debugging
> there's a bug where users can submit empty forms - fix it
> paste error message here - help me fix it
> analyze why the login fails
Testing & Documentation
> write unit tests for the calculator functions
> update the README with installation instructions
> add inline documentation to this function
> review my changes and suggest improvements

Extensions & Customization

MCP Servers - Expand Claude's Capabilities

Model Context Protocol (MCP) servers give Claude access to external tools, APIs, and data sources. They're like plugins that extend what Claude can do.


Popular MCP Servers:
  • @modelcontextprotocol/server-filesystem - Enhanced file system access
  • @modelcontextprotocol/server-github - Deep GitHub integration
  • @modelcontextprotocol/server-postgres - Direct database queries
  • @modelcontextprotocol/server-brave-search - Web search capabilities
  • @modelcontextprotocol/server-slack - Slack workspace integration
Installing MCP Servers
# Add to claude_desktop_config.json in settings
# Location: ~/Library/Application Support/Claude/

{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "your-token-here"
}
}
}
}
๐Ÿ’ก Quick Setup
Access settings with claude settings command or use VS Code's Claude extension settings panel.
Hooks - Automate Your Workflow

Hooks are shell commands that run automatically in response to Claude events. Perfect for running tests, formatters, or custom validations.


Available Hooks:
  • onSessionStart - Runs when starting a session
  • onToolCall - Runs before/after tool execution
  • onFileChange - Runs when files are modified
  • onUserPromptSubmit - Runs when you send a message
Hook Configuration Example
# In your settings file
{
"hooks": {
"onFileChange": {
"command": "npm run format",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules/**"]
},
"onToolCall": {
"before": {
"Bash": "echo 'Running: $TOOL_ARGS'"
},
"after": {
"Edit": "prettier --write $FILE_PATH"
}
}
}
}
IDE Integration

Claude Code integrates with popular editors:

  • VS Code: Native extension with inline chat and file context
  • Cursor: Built-in Claude integration
  • JetBrains: Plugin available for IntelliJ IDEA, PyCharm, etc.
# Open current directory in VS Code with Claude
code . && claude

Git Operations

Common Git Commands
> what files have I changed?
> commit my changes with a descriptive message
> create a new branch called feature/quickstart
> show me the last 5 commits
> help me resolve merge conflicts
Pull Request Workflow
> create a pull request for this feature
> review the changes in this PR
> help me address the review comments

# Or use the skill
/review-pr 123

Pro Tips & Best Practices

๐Ÿ’ก Be Specific
Instead of: "fix the bug"
Try: "fix the login bug where users see a blank screen after entering wrong credentials"
๐Ÿ’ก Break Down Complex Tasks
> 1. create a new database table for user profiles
> 2. create an API endpoint to get and update user profiles
> 3. build a webpage that allows users to see and edit their information
๐Ÿ’ก Let Claude Explore First
> analyze the database schema before making changes
> read the authentication module and explain how it works
๐Ÿ’ก Use CLAUDE.md File
Create a CLAUDE.md file in your project root to provide context:
  • Project overview and architecture
  • Coding standards and conventions
  • Dependencies and setup instructions
  • Custom commands and workflows
  • Important gotchas or common mistakes to avoid
Claude automatically reads this file at the start of each session.
๐Ÿ’ก Talk Like a Colleague
Talk to Claude Code like you would a helpful colleague - describe what you want to achieve in natural language, and Claude will help you get there.
๐Ÿ’ก Context is King
Claude can see your entire conversation history. Reference earlier work by saying things like "using the approach we discussed earlier" or "in the file we just modified."
๐Ÿ’ก Use Plan Mode for Big Changes
> let's plan out how to refactor the authentication system

# Claude will enter plan mode, explore your codebase,
# and present a detailed implementation plan for your approval
๐Ÿ’ก Iterative Development Works Best
Start with a working version, then improve:
> create a simple login form
> now add validation
> add password strength indicator
> now add remember me functionality
๐Ÿ’ก Accept All Mode for Trusted Changes
Press Shift+Tab to toggle "accept all" mode when you trust Claude to make multiple changes without reviewing each one. Great for large refactors or formatting changes.

Advanced Features

Permission Modes

Claude always asks for permission before modifying files:

  • Individual approval: Review each change (default)
  • Accept all mode: Auto-approve for current session (Shift+Tab to toggle)
  • Sandbox mode: Test commands safely before execution
Sub-agents & Parallel Execution

Claude can spawn specialized agents that work autonomously on specific tasks:

  • Explore agent: Deep codebase exploration
  • Plan agent: Create implementation strategies
  • Task agents: Handle complex multi-step workflows
> explore how authentication works in this codebase
> create a plan for adding OAuth support
Background Tasks

Run long-running commands in the background while continuing to work:

> run the test suite in the background
> start the development server in the background

# Check status anytime
/tasks
Session Management
Feature Description
Resume sessions Pick up exactly where you left off with /resume
Name sessions Use /rename to label sessions for easy finding
Continue work Use claude -c to continue most recent conversation
Context persistence Full conversation history maintained across sessions
Multi-Model Support

Claude Code can use different Claude models for different tasks:

  • Sonnet 4.5: Default - balanced speed and capability
  • Opus 4.5: Maximum intelligence for complex tasks
  • Haiku: Fast responses for simple operations
# Configure in settings or per-task
> use opus for this complex refactoring task
Environment Variables & Secrets

Claude can securely access environment variables and secrets:

# Add to your .env file
DATABASE_URL=postgresql://...
API_KEY=sk-...

# Claude can read these for configuration
> set up the database connection using DATABASE_URL
> test the API using the credentials in .env
Getting Help