Cheat Sheet · Commands & Shortcuts
Claude Code
Everything you need to drive Claude Code from the terminal, in one reference: slash commands, keyboard shortcuts, CLI flags and the input modes that make it fast. Bookmark this page, it stays current with each release.
CLI commands & flags
claude | Start an interactive session in the current directory |
claude "fix the build" | Start with an initial prompt |
claude -p "…" | Print mode, run once, print the result, exit (great for scripts/CI) |
claude -c | Continue the most recent conversation |
claude -r | Resume, pick a previous conversation to continue |
claude --model <name> | Choose the model for the session |
claude commit | Create a git commit from the staged changes |
claude mcp | Configure and manage MCP servers |
claude update | Update Claude Code to the latest version |
claude --dangerously-skip-permissions | Skip permission prompts (sandboxed/CI use only) |
Slash commands (in-session)
/help | List available commands |
/clear | Clear the conversation history and free up context |
/compact | Summarize and compress the conversation to save context |
/init | Generate a CLAUDE.md describing the project |
/memory | Edit CLAUDE.md memory files |
/model | Switch the active model |
/config | Open settings |
/permissions | View and edit tool permissions |
/agents | Create and manage subagents |
/mcp | Manage MCP server connections |
/hooks | Configure hooks that run on tool events |
/review | Review a pull request |
/cost | Show token usage and cost for the session |
/doctor | Diagnose your Claude Code installation |
/login · /logout | Switch Anthropic accounts |
/vim | Toggle vim keybindings in the input |
Keyboard shortcuts & input modes
Esc | Interrupt Claude mid-response |
Esc Esc | Rewind, edit a previous message and branch |
Shift+Tab | Cycle modes: normal → auto-accept edits → plan mode |
@ | Mention a file or directory to add it to context |
/ | Open the slash-command menu |
# | Quick-add a note to CLAUDE.md memory |
! | Bash mode, run a shell command directly |
Ctrl+V | Paste an image from the clipboard |
Ctrl+L | Clear the terminal screen |
Ctrl+C | Cancel the current input / exit |
Up / Down | Navigate input history |
Run an agent without the setup
Spin up a hosted open-source AI agent with Creative Tim, bring your own key or run it on credits.
Frequently asked questions
What's the difference between a slash command and a CLI flag?
CLI flags (like -p or --model) are passed when you launch claude from your shell. Slash commands (like /clear or /model) are typed inside a running session.
How do I save context on long sessions?
Use /compact to summarize the conversation, or /clear to start fresh. Add durable facts to CLAUDE.md with /memory or the # shortcut so they persist across sessions.
What does Shift+Tab do?
It cycles input modes: normal, auto-accept edits (Claude applies edits without asking), and plan mode (Claude proposes a plan before acting).
Is there a hosted way to run Claude Code?
Yes, Creative Tim hosts open-source agent harnesses you can spawn in seconds and drive with Claude models, without local setup.
Compare Claude Code