Quick Reference Card

Every Claude Code Command and Shortcut in One Place

Stop reading about it. Build something.

Bookmark this page. It covers every major Claude Code command, shortcut, CLAUDE.md directive, and workflow pattern you need for productive daily development.

Slash Commands

Type these inside an active Claude Code session. Press Tab to autocomplete.

slash commands
/helpShow all available slash commands
/clearClear conversation history and start fresh
/compactCompress conversation to save context window space
/memoryView and manage memory files Claude is tracking
/modelSwitch between Claude models (opus, sonnet, haiku)
/costShow token usage and cost for the current session
/doctorDiagnose Claude Code configuration issues
/initInitialize a new CLAUDE.md in the current directory
/reviewRun a code review on staged or specified files
/commitGenerate a commit message and stage changes

CLI Flags

Flags you pass to the claude command at startup.

$ claude [flags]
--print / -pPrint Claude's response to stdout without interactive mode
--modelSpecify model: claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5
--no-waitFor Vercel deploys — avoids hanging log streams
--dangerously-skip-permissionsSkip all permission prompts (CI/CD pipelines only)
--add-dirAdd a directory to Claude's allowed read paths
--max-turnsCap agentic turns for automated runs

CLAUDE.md Sections

Recommended sections for your CLAUDE.md. Claude reads this file at session start — make every line count.

## CommandsBuild, test, lint, and deploy commands Claude should know
## Style GuideCode formatting, naming conventions, preferred libraries
## ArchitectureTech stack, database patterns, auth setup
## ContextWho is the developer, what is the project, what matters most
## Don'tsExplicit constraints — never select("*"), never shell=True, etc.
@path/to/file.mdImport another Markdown file into CLAUDE.md scope

Keyboard Shortcuts

Ctrl+CCancel current Claude response mid-stream
Ctrl+LClear the terminal screen
↑ ArrowCycle through previous prompts
TabAutocomplete file paths and slash commands
Shift+EnterInsert newline without submitting (multiline prompts)

Power User Patterns

Start every session with /memory

Check what Claude remembers before diving in. Stale memory entries cause bad output. Delete outdated entries before they corrupt your session.

Use /compact aggressively on long sessions

Context window pressure is real. Running /compact mid-session compresses history without losing the important bits. Cheaper and faster than starting over.

Pipe output with -p for scripts

claude -p 'review this diff for security issues' < git.diff pipes cleanly into shell scripts. Use it in pre-commit hooks, CI checks, or batch review pipelines.

Layer CLAUDE.md files

Root CLAUDE.md for project-wide rules. Subdirectory CLAUDE.md for module-specific context. Claude reads both — narrower files override broader ones.

/model haiku for simple edits

Switch to Haiku for rename, format, or boilerplate tasks. Faster, cheaper, and frees Sonnet/Opus quota for complex reasoning work.

Learn ChatGPT Code hands-on

Free interactive lessons. No credit card required.