:keys 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 / →
Toggle extended thinking
Alt + t
:prompt claude prompt box 14 tricks # Prefixes and editing tricks for what you type.
Run a shell command; its output lands in the context
! git status
Mention a file or folder (autocompletes)
@src/app.ts explain this
Run a command or skill (a / mid-prompt only completes)
/help
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
/terminal-setup
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
:modes 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
/plan add a dark mode
Start in a permission mode
$ claude --permission-mode plan $ claude --permission-mode acceptEdits
Think harder for one turn: write ultrathink anywhere in the prompt
Set effort (no argument opens a slider)
/effort high$ claude --effort xhigh
Switch model and save it as the default
/model opus$ claude --model sonnet
Fall back to another model when overloaded
$ claude --fallback-model sonnet
Fast mode on / off
/fast on/fast off
Change the answer style
/output-style Explanatory/output-style Learning
:rewind 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
/rewind
Continue the last conversation in this folder
$ claude -c
Pick a conversation to resume (with a search term)
$ claude -r $ claude -r auth /resume
Resume as a copy, leaving the original untouched
$ claude -c --fork-session
Branch the conversation from here
/branch try-redis/fork
Resume the session linked to a pull request
$ claude --from-pr 123
Name the session (shown in the picker and title bar)
/rename auth-refactor$ claude -n auth-refactor
Export the conversation as text / copy the last answer
/export notes.txt/copy
Recap of what happened in this session
/recap
Review the uncommitted changes
/diff
:context claude context and cost 7 tricks # Keep the context window lean.
See what fills the context window
/context
Summarise the conversation, keeping what you name
/compact keep the API decisions
Start fresh (optionally naming the old one)
/clear /clear old-spike
Ask a side question that stays out of the history
/btw what does --frozen-lockfile do?
Cost, plan limits and activity
/usage /cost
Give Claude access to another folder
/add-dir ../shared$ claude --add-dir ../shared
Auto-compact at a fixed size
$ claude --autocompact 200k
:commands 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)
/review /review 123 --comment/review --fix
Security review of the pending changes
/security-review
Build a status line from a description
/statusline show branch and context %
Rebind any shortcut (~/.claude/keybindings.json)
/keybindings
Repeat a prompt on an interval
/loop 5m check the deploy
Schedule a cloud agent
/schedule every weekday 9am triage new issues
Generate a CLAUDE.md for this repo
/init
Allow, ask or deny tools without prompting
/permissions
Run commands in a sandbox
/sandbox
Connect your editor / the GitHub app
/ide /install-github-app
Diagnose the install and settings
/doctor $ claude doctor
Report a bug with the conversation attached
/bug
:headless claude headless and scripting 9 tricks # Use claude in pipes, scripts and CI with -p.
Ask once and print the answer
$ claude -p "summarise the README"
Pipe input in
$ cat error.log | claude -p "what failed?" $ git diff | claude -p "write a commit message"
Continue the last session headlessly
$ claude -c -p "now add tests"
JSON result / streamed events
$ claude -p "..." --output-format json $ claude -p "..." --output-format stream-json --verbose
Force output that matches a JSON Schema
$ claude -p "list the TODOs" --json-schema schema.json
Cap the turns / the spend
$ claude -p "..." --max-turns 5 $ claude -p "..." --max-budget-usd 2
Pre-approve or block tools
$ claude -p "..." --allowedTools "Bash(git *)" Edit $ claude --disallowedTools WebFetch
Add to (or replace) the system prompt
$ claude --append-system-prompt "answer in Portuguese" $ claude --system-prompt-file prompt.md
Throwaway session that is never saved
$ claude -p "..." --no-session-persistence
:launch 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)
$ claude -w feature-x $ claude -w feature-x --tmux
Run a session in the background
$ claude --bg "fix the flaky test"
List, open, read and stop background sessions
$ claude agents $ claude attach <id> $ claude logs <id> $ claude stop <id>
Start with every customisation off (debug a broken setup)
$ claude --safe-mode
Minimal mode: no hooks, plugins, memory or CLAUDE.md
$ claude --bare
Debug only some subsystems
$ claude --debug=hooks,mcp
Define subagents inline
$ claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You review code"}}'
Load a plugin from a folder for this session only
$ claude --plugin-dir ./my-plugin
Control from your phone (Remote Control)
$ claude --remote-control
Cloud multi-agent review of the branch
$ claude ultrareview
Add an MCP server (HTTP / stdio)
$ claude mcp add --transport http sentry https://mcp.sentry.dev/mcp $ claude mcp add db -e DB_URL=... -- npx db-mcp
Update / delete this project's local history
$ claude update $ claude purge
:memory claude memory and settings files 10 tricks # Where instructions and settings live; edit memory with /memory.
Memory for every project: ~/.claude/CLAUDE.md
/memory
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
@docs/architecture.md
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
/config
Project MCP servers: .mcp.json; subagents: .claude/agents/
:skills 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)
!`git diff --stat`
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
/hooks
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
:env claude environment variables 7 tricks # Set in your shell or under "env" in settings.json.
Longer default / maximum Bash timeout (ms)
$ BASH_DEFAULT_TIMEOUT_MS=300000 claude $ BASH_MAX_TIMEOUT_MS=1200000 claude
Default model / effort for new sessions
$ ANTHROPIC_MODEL=opus claude $ CLAUDE_CODE_EFFORT_LEVEL=high claude
Turn off auto memory
$ CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 claude
Turn off Ctrl+B and background tasks
$ CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 claude
No non-essential network traffic
$ CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 claude
Share one task list across sessions
$ CLAUDE_CODE_TASK_LIST_ID=release claude
Interactive, guided /init
$ CLAUDE_CODE_NEW_INIT=1 claude
:gotchas 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