~/cheatsheets (main) $ claude --help

claude cheat sheet

Claude Code is an agentic coding assistant that runs in your terminal. Most of its power hides behind a keystroke: a prefix in the prompt box, a double Esc, a flag nobody mentions. Keys work in the prompt box; commands starting with / are typed there too, the rest run in your shell. Shortcuts with Alt need Option on macOS (set your terminal to use Option as Meta): pick yours below and every shortcut updates. Click a command to copy it.

meta
print

claude keyboard shortcuts

19 tricks

# In the prompt box while Claude is idle or working.

Show every shortcut (on an empty prompt)
?
Interrupt Claude; queued messages send next
Esc
Clear the input / exit (press twice)
Ctrl+c / Ctrl+d
Search prompt history
Ctrl+r
Previous / next prompt in history
Ctrl+p / Ctrl+n
Show the full transcript (tool calls and all)
Ctrl+o
Show / hide the task checklist
Ctrl+t
Send a running command or agent to the background
Ctrl+b
Stop every background subagent (twice within 3 s)
Ctrl+x then Ctrl+k
Write the prompt in your $EDITOR
Ctrl+g / Ctrl+x then Ctrl+e
Stash the prompt; press again on an empty prompt to restore it
Ctrl+s
Undo the last edit in the prompt
Ctrl+_
Paste an image as [Image #N] (Alt+V on Windows, Cmd+V in iTerm2)
Ctrl+v
Redraw the screen, keeping input and history
Ctrl+l
Suspend to the shell (fg brings it back, Unix only)
Ctrl+z
Accept a prompt suggestion or completion
Tab / →
Switch model
Alt+p
Toggle extended thinking
Alt+t
Toggle fast mode
Alt+o

claude prompt box

14 tricks

# Prefixes and editing tricks for what you type.

Run a shell command; its output lands in the context
Mention a file or folder (autocompletes)
Run a command or skill (a / mid-prompt only completes)
New line, in any terminal
\ then Enter / Ctrl+j
New line in iTerm2, Ghostty, Kitty, WezTerm, Warp, Windows Terminal
Shift+Enter
New line with the meta key (macOS: Option as Meta)
Alt+Enter
Install the Shift+Enter binding in other terminals
Queue a message while Claude works / take queued ones back
Enter / ↑
Send queued messages right now
Ctrl+Enter / Ctrl+x then Ctrl+s
Kill to end of line / to start / previous word, then yank
Ctrl+k / Ctrl+u / Ctrl+w / Ctrl+y
Start / end of line
Ctrl+a / Ctrl+e
Word back / forward / delete word
Alt+b / Alt+f / Alt+d
Cycle older pastes after a yank
Alt+y
Clear the draft into history (Up brings it back)
Esc then Esc

claude modes, models and thinking

9 tricks

# How much Claude may do on its own, and how hard it thinks.

Cycle default → accept edits → plan mode
Shift+Tab
Plan mode: research and propose, no edits
Shift+Tab then Shift+Tab
Start in a permission mode
Think harder for one turn: write ultrathink anywhere in the prompt
Set effort (no argument opens a slider)
Switch model and save it as the default
Fall back to another model when overloaded
Fast mode on / off
Change the answer style

claude rewind and sessions

10 tricks

# Undo what Claude did and come back to old conversations.

Rewind the conversation and/or code to an earlier prompt
Esc then Esc
Continue the last conversation in this folder
Pick a conversation to resume (with a search term)
Resume as a copy, leaving the original untouched
Branch the conversation from here
Resume the session linked to a pull request
Name the session (shown in the picker and title bar)
Export the conversation as text / copy the last answer
Recap of what happened in this session
Review the uncommitted changes

claude context and cost

7 tricks

# Keep the context window lean.

See what fills the context window
Summarise the conversation, keeping what you name
Start fresh (optionally naming the old one)
Ask a side question that stays out of the history
Cost, plan limits and activity
Give Claude access to another folder
Auto-compact at a fixed size

claude lesser-known slash commands

12 tricks

# Built in, and easy to miss.

Review the branch, a PR or a path (and fix or comment)
Security review of the pending changes
Build a status line from a description
Rebind any shortcut (~/.claude/keybindings.json)
Repeat a prompt on an interval
Schedule a cloud agent
Generate a CLAUDE.md for this repo
Allow, ask or deny tools without prompting
Run commands in a sandbox
Connect your editor / the GitHub app
Diagnose the install and settings
Report a bug with the conversation attached

claude headless and scripting

9 tricks

# Use claude in pipes, scripts and CI with -p.

Ask once and print the answer
Pipe input in
Continue the last session headlessly
JSON result / streamed events
Force output that matches a JSON Schema
Cap the turns / the spend
Pre-approve or block tools
Add to (or replace) the system prompt
Throwaway session that is never saved

claude launch flags and subcommands

12 tricks

# Ways to start claude you might not know about.

Work in a fresh git worktree (optionally in tmux)
Run a session in the background
List, open, read and stop background sessions
Start with every customisation off (debug a broken setup)
Minimal mode: no hooks, plugins, memory or CLAUDE.md
Debug only some subsystems
Define subagents inline
Load a plugin from a folder for this session only
Control from your phone (Remote Control)
Cloud multi-agent review of the branch
Add an MCP server (HTTP / stdio)
Update / delete this project's local history

claude memory and settings files

10 tricks

# Where instructions and settings live; edit memory with /memory.

Memory for every project: ~/.claude/CLAUDE.md
Project memory, committed: ./CLAUDE.md or ./.claude/CLAUDE.md
Personal project memory, gitignored: ./CLAUDE.local.md
CLAUDE.md in a subfolder loads when Claude works in it
Import another file into CLAUDE.md with @path
Modular rules: .claude/rules/*.md (paths: frontmatter scopes them to files)
Settings: ~/.claude/settings.json, .claude/settings.json, .claude/settings.local.json
Precedence: managed > --settings > local > project > user
Set one setting from the prompt
Project MCP servers: .mcp.json; subagents: .claude/agents/

claude skills and hooks

11 tricks

# Your own commands (.claude/skills/<name>/SKILL.md) and scripts on events.

In SKILL.md, $ARGUMENTS is everything typed after the name; $0, $1… one by one
Run a shell command before Claude reads the skill (output inlined)
allowed-tools: Bash(git *) Read lets the skill use them without asking
disable-model-invocation: true means only you can run it, never Claude
context: fork, model: and effort: run the skill apart, on its own model
Old .claude/commands/*.md still work (a skill wins a name clash)
See the hooks that are configured
Block a tool call: a PreToolUse hook exits 2 (stderr goes to Claude)
Keep Claude working: a Stop hook exits 2 with the reason
Hook matchers: Edit|Write, mcp__github__.*, * for everything
Useful events: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Notification, PreCompact, Stop

claude environment variables

7 tricks

# Set in your shell or under "env" in settings.json.

Longer default / maximum Bash timeout (ms)
Default model / effort for new sessions
Turn off auto memory
Turn off Ctrl+B and background tasks
No non-essential network traffic
Share one task list across sessions
Interactive, guided /init

claude good to know

6 tricks

# Behaviour that surprises people.

Rewind only restores edits made by Claude’s edit tools, not files changed by Bash (rm, mv, scripts)
Checkpoints keep the last 100 prompts and are not a replacement for git
think / think hard are plain words now; only ultrathink raises the effort
Option shortcuts on macOS need “Option as Meta” in the terminal settings
Prompt history is per folder
Exit plan mode at the approval prompt with Esc, then Shift+Tab
Esc then Shift+Tab