DEV Community

Alex Spinov
Alex Spinov

Posted on

The Only Claude Code Cheatsheet You Need (Bookmarkable)

I've been using Claude Code daily for 2 weeks. Here's every command, shortcut, and trick I use — distilled into one cheatsheet.

Bookmark this. You'll come back to it.


Essential Commands

claude              # Start interactive session
claude "do X"       # One-shot command
claude -p "prompt"  # Print mode (no interactive)
claude --fast       # Faster output
Enter fullscreen mode Exit fullscreen mode

Slash Commands

Command What it does
/help Show all commands
/clear Reset conversation context
/compact Compress context to save tokens
/cost Show token usage
/init Create CLAUDE.md for your project
/commit Smart commit from changes

Keyboard Shortcuts

Key Action
Enter Send message
Shift+Enter New line
Ctrl+C Cancel
Ctrl+D Exit
Tab Accept suggestion

The CLAUDE.md File

This is the single most important feature most people miss.

Create CLAUDE.md in your project root:

# My Project

## Stack
- React + TypeScript frontend
- Python FastAPI backend
- PostgreSQL database

## Rules
- Conventional commits only
- All functions need type hints
- Never commit .env files
Enter fullscreen mode Exit fullscreen mode

Claude Code reads this automatically every session. No more repeating yourself.

Skills (Reusable Prompts)

Create .claude/skills/review.md:

---
name: review
description: Code review for bugs and security
---

Review git diff for:
1. Bugs and logic errors
2. Security issues
3. Performance problems

Show file, line, issue, and fix.
Enter fullscreen mode Exit fullscreen mode

Use it: /review

MCP Servers (External Tools)

Configure in .claude/mcp.json:

{
  "servers": {
    "github": {
      "command": "github-mcp-server"
    },
    "playwright": {
      "command": "playwright-mcp-server"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Now Claude Code can browse the web, manage GitHub repos, query databases — anything the MCP server exposes.

My Top 5 Productivity Tricks

1. Read → Edit Pattern

Always tell Claude to read a file before editing. "Read auth.py and fix the login bug on line 42" > "Fix the auth bug."

2. Chain Actions

"Read the test file, run the failing test, read the error, fix it, run the test again." — One prompt, five actions.

3. Sub-Agents for Research

Claude Code can spawn background agents. "Research how Next.js 15 handles caching and save findings to research.md"

4. /compact When Slow

If responses get slow, your context is full. /compact compresses it.

5. Be Specific > Be Polite

"Refactor UserService to use dependency injection, keep the same public API" > "Could you maybe clean up the user service a bit?"


Full Cheatsheet Repo

I maintain a complete, updated cheatsheet here:

claude-code-cheatsheet — Star it for quick reference.

More resources:


What's your favorite Claude Code trick? Drop it in the comments — I'll add the best ones to the cheatsheet.


Follow for more AI developer tools content.

Top comments (0)