Tech / Claude Code Reference
Claude Code Reference
CLI commands · slash commands · keyboard shortcuts
Static snapshot pulled 08/27/26 from Anthropic's official docs -- not live-synced, will drift. Type /help inside a live session for the exact current set (varies by platform/plan/version).
Full references: Official Cheat Sheet · CLI Reference · Commands Reference
Starting a Session (Terminal)
CommandWhat it does
claudeStart interactive session in current project
claude "query"Start session with an initial prompt
claude -p "query"Print mode -- run prompt, then exit (good for scripts/CI)
claude -cContinue the most recent conversation in this directory
claude -r "name" "query"Resume a session by ID or name
claude updateUpdate to the latest version
cat file | claude -p "query"Pipe file content as input
Session Control (Slash Commands)
CommandWhat it does
/helpList all available commands -- run this first in a new session
/clearWipe conversation, keep project memory. Aliases: /reset, /new
/compactSummarize the conversation to free up context
/exitQuit the CLI. Alias: /quit
/statusShow account, model, working directory, version
/costShow token usage and spend for this session
/usageShow plan usage limits and rate-limit status
/modelView or switch the active model
Context & Navigation
CommandWhat it does
/resumeReopen a previous session by ID or name. Alias: /continue
/rewindRoll conversation and/or code back to an earlier checkpoint
/diffInteractive viewer of uncommitted changes and per-turn diffs
/copyCopy the last response (or a code block) to clipboard
/exportSave the current conversation to a file or clipboard
/btwAsk a quick side question without adding it to the conversation
/contextVisualize what's loaded into the context window and where it's spent
/memoryView or edit the CLAUDE.md files in scope
/add-dirGrant file access to an additional directory for this session
Configuration & Setup
CommandWhat it does
/initExplore the codebase and generate a starter CLAUDE.md
/configOpen settings (theme, defaults, editor mode). Alias: /settings
/permissionsView/edit allow, ask, deny rules for tool permissions
/mcpManage MCP server connections and authentication
/agentsList, create, or edit subagents
/hooksView hook configuration for tool events
/skillsList the skills available in this session
/doctorDiagnose install and environment issues
/login / /logoutAuthenticate, switch accounts, or sign out
/feedbackReport an issue to Anthropic with session context. Alias: /bug
Keyboard Shortcuts
KeyAction
Shift + TabCycle permission mode: auto → manual → acceptEdits → plan
EscInterrupt Claude mid-response so you can type again
Esc, EscOpen the rewind/checkpoint menu to roll back
Ctrl + CCancel current input, or exit on an empty prompt
Ctrl + RReverse search through prompt history
Ctrl + OExpand to the verbose, full transcript view
↑ / ↓Scroll through prompt history
@ + pathReference a file or directory in your prompt
/Open the command menu
?Show shortcuts for your current terminal/IDE
Common CLI Flags
FlagWhat it does
--modelSet the model (alias like "sonnet" or a full ID)
--permission-modeStart in a specific mode (default/plan/acceptEdits/bypassPermissions)
--allowedToolsTools that execute without prompting
--output-formatOutput format for print mode: text, json, stream-json
--max-turnsLimit agentic turns in print mode
--verboseFull turn-by-turn logging
--continue / -cLoad most recent conversation
--resume / -rResume session by ID or name