Start a session
From your terminal.
claude- Open an interactive session in this folder
claude "fix the build"- Start with a first prompt
claude -p "query"- Print the answer and exit. Pipe input in with
cat log | claude -p claude -c- Continue the last conversation in this folder
claude -r- Pick a past session to resume, or pass its name or ID
claude -w feature-x- Work in a fresh git worktree so main stays clean
claude --bg "task"- Start as a background agent
claude update- Update Claude Code
claude doctor- Check the install and config
Launch flags
Add to any claude command.
--model opus- Pick the model:
opus,sonnet,haiku,fableor a full name --effort high- Thinking effort, from
lowtomax --permission-mode plan- Start in a given mode
--add-dir ../shared- Let Claude read and edit another folder
--allowedTools "Bash(git log *)"- Tools that run without asking
--disallowedTools "WebFetch"- Tools that are always refused
--mcp-config servers.json- Load MCP servers for this run
--append-system-prompt "..."- Add your own instructions on top of the defaults
--output-format json- Machine-readable output in print mode; also
stream-json --max-turns 10- Cap a print-mode run
--chrome- Turn on Claude in Chrome for this session
--bare- Skip hooks, skills, plugins, MCP and CLAUDE.md
--dangerously-skip-permissions- No prompts at all. Only inside a sandbox you trust
Keys
Inside a session. On a Mac, Alt is Option.
- Shift Tab
- Cycle permission modes
- Esc Esc
- Empty prompt: open rewind. With text: clear the draft
- Ctrl C
- Stop what's running; twice when idle to exit
- Ctrl B
- Send running commands and agents to the background
- Ctrl R
- Search your prompt history
- Ctrl O
- Show the full transcript with tool details
- Ctrl T
- Show or hide Claude's task list
- Ctrl S
- Stash the prompt; press again to bring it back
- Ctrl G
- Write the prompt in your own editor
- Alt V
- Paste an image on Windows (Ctrl+V elsewhere)
- Alt T
- Toggle extended thinking on models that allow it
- Alt P
- Switch model without losing your prompt
- Alt O
- Toggle fast mode
- @
- Mention a file or folder
- !
- Run a shell command directly
- /
- Commands and skills
Everyday commands
Type at the prompt.
/clear- New conversation, empty context
/compact- Summarize to free up context; add a focus if you like
/context- See what's filling the context window
/model- Switch model and keep it as the default
/effort- Set how hard Claude thinks
/resume- Pick up an earlier session
/rewind- Roll back code, conversation or both
/init- Write a starter CLAUDE.md for this project
/memory- Edit CLAUDE.md files, toggle auto memory
/permissions- Manage allow, ask and deny rules
/config- All settings in one screen
/usage- Session cost and plan limits
/status- Version, model, account and which settings loaded
/doctor- Check the setup and offer fixes
/export- Save the conversation as text
Power moves
Commands for long or parallel work.
/plan- Think it through before touching code
/goal- Keep going across turns until a condition is met
/btw- Ask a side question that stays out of the history
/branch- Try another direction without losing this one
/fork- Copy the conversation into a background session
/background- Detach this session to keep running
/tasks- See background work
/batch- Fan a change out to parallel worktrees, one PR each
/loop 5m /foo- Repeat a prompt on an interval while the session is open
/schedule- Cloud routines that run on a cron
/code-review- Review the diff or a PR, from
lowtoultra /security-review- Scan the branch for security issues
/simplify- Find and apply cleanups
/fast- Faster output on supported models
Memory
CLAUDE.md files load every session, from the folder you're in and every folder above it.
~/.claude/CLAUDE.md- You, across every project
./CLAUDE.md- The project, shared through git
./CLAUDE.local.md- You, this project only; keep it out of git
.claude/rules/- Rules split into separate files
@docs/style.md- Inside CLAUDE.md, pulls another file in
AGENTS.md- Read when there's no CLAUDE.md
- Auto memory
- Notes Claude keeps for itself in
MEMORY.md
Settings
JSON files. Highest wins: managed, then --settings, then local, project, user. Allow and deny lists merge.
~/.claude/settings.json- Yours, everywhere
.claude/settings.json- The team's, committed
.claude/settings.local.json- Yours, this project, not committed
permissions.allow / deny- What runs without asking, and what never runs
permissions.defaultMode- Starting permission mode
env- Environment variables for every session
model- Starting model
hooks- Your scripts on lifecycle events
sandbox.enabled- OS-level sandbox for commands (macOS, Linux, WSL2)
enabledPlugins- Which plugins load
Extend it
Each one works at user level (~/.claude) or project level (.claude).
Skills
skills/<name>/SKILL.md- Reusable know-how. Claude loads it when relevant, or you call
/name
Subagents
agents/<name>.md- A helper with its own tools, model and context.
/agentsto manage
Hooks
PreToolUse,PostToolUse- Check or block a tool call, react after it
UserPromptSubmit,Stop- Act on every prompt, or when Claude finishes
SessionStart,SessionEnd- Set up and tear down
MCP servers
claude mcp add --transport http name url- Connect a tool server.
--scopeislocal,projectoruser /mcp- Status and sign-in inside a session
Plugins
/plugin- Browse marketplaces, install bundles of skills, agents, hooks and MCP
/output-style- Change how Claude responds: Concise, Explanatory, Learning and more
Safety nets
For when something goes sideways.
- Checkpoints
- Every prompt saves one; Esc Esc or
/rewindto go back. Changes made only through shell commands aren't covered, so keep using git - Worktrees
claude -w namegives each task its own branch and folder- Sandbox
/sandboxfences file and network access. Not on native Windows--safe-mode- Start with every customization off to troubleshoot
Where it runs
Same agent, different front ends.
- Terminal
- The CLI, plus print mode for scripts and cron
- VS Code, JetBrains
- Inside your editor
- Desktop app
- Mac and Windows;
claude --desktophands off - Web and mobile
- Cloud sessions at claude.ai/code
- Chrome
- Drives your real browser with
--chrome - GitHub Actions, GitLab
- Mention Claude in a PR or issue
- Remote Control
- Steer a local session from your phone:
/remote-control - Agent SDK
- Build your own app on the same harness
Environment variables
Set in your shell or under env in settings.
ANTHROPIC_MODEL- Default model;
--modeloverrides it ANTHROPIC_API_KEY- Use an API key instead of a subscription
CLAUDE_CODE_EFFORT_LEVEL- Default effort
CLAUDE_CONFIG_DIR- Move the ~/.claude folder
BASH_DEFAULT_TIMEOUT_MS- How long a shell command may run
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC- Turn off non-essential network calls
Nothing matches. Try a shorter word, or /help inside Claude Code.
