Chapter 8 · Bookmark this · Lookup page
Bookmark this chapter. It's the lookup page — not a tutorial. When you've forgotten a shortcut mid-flow, scroll here, grab it, move on.
Type / in any Claude Code conversation to see the full list filtered to your plan, platform, and installed plugins. These are the built-ins worth knowing.
| Command | What it does |
|---|---|
/clear | Start a new conversation. Previous one still archived — resume with /resume. |
/compact [focus] | Keep the conversation, summarise history, free context. Optional focus narrows what to keep. |
/resume | Pick up a previous conversation. |
/rewind | Checkpoint menu — restore code, conversation, or both to an earlier state. Same as double-Esc. |
/branch | Fork the conversation from a given point. |
/exit | Quit Claude Code (or Ctrl+D). |
| Command | What it does |
|---|---|
/init | Scan the repo and propose a starting CLAUDE.md. Set CLAUDE_CODE_NEW_INIT=1 for the new multi-phase interactive flow. |
/memory | View or edit CLAUDE.md files and loaded memory. |
/permissions | Manage tool allow/deny rules. |
/model | Switch model mid-conversation (e.g., Opus → Sonnet). |
/effort | Per-session effort override. |
/keybindings | Open ~/.claude/keybindings.json. |
/hooks | Configure lifecycle hooks. |
/config | Open the settings UI. |
/theme | Switch terminal theme. |
| Command | What it does |
|---|---|
/help | List commands. |
/context | Visualise current context-window usage with optimisation hints. |
/cost | Session cost so far. |
/usage, /stats | Broader usage metrics. |
/doctor | Diagnostics — surfaces config conflicts, missing setup. |
| Command | What it does |
|---|---|
/agents | Manage subagents (create, edit, delete). |
/plugin | Install or manage plugins. |
/mcp | Install or manage MCP servers. |
/skills | List installed skills. |
/review | Bundled PR-style review skill. |
/security-review | Bundled security review skill. |
/diff | Show diff since last checkpoint. |
| Command | What it does |
|---|---|
/remote-control (alias /rc) | Make the current session drivable from phone or browser. |
/mobile | QR code to open the session in Claude mobile app. |
/teleport (alias /tp) | Pull a Claude-Code-on-Web session into your terminal. |
/web-setup | Set up Claude Code on the Web for the current repo. |
| Command | What it does |
|---|---|
/loop <interval> <task> | Run <task> every interval. |
/schedule | Create or manage cron-scheduled remote agents. |
/learn | Capture session insights to memory. |
/handoff | Prepare a handoff doc for the next session or teammate. |
/compound | Document a solved problem for future reference. |
CLI shortcuts are context-specific. Full list at code.claude.com/docs/en/keybindings ↗. Edit your own at ~/.claude/keybindings.json via /keybindings.
| Shortcut | Action |
|---|---|
Esc Esc | Rewind — restore to a previous message (same as /rewind). |
Ctrl+C | Interrupt current input or response. Does not exit. Reserved. |
Ctrl+D | Exit Claude Code. Reserved. |
Shift+Tab | Cycle permission mode: default → acceptEdits → plan → auto. |
Ctrl+R | Reverse-search conversation history. |
Ctrl+O | Toggle verbose transcript (expands collapsed tool calls). |
Ctrl+T | Toggle task list. |
Ctrl+B | Background the current task. (Conflicts with tmux prefix — press twice.) |
Ctrl+J | Newline without submitting. |
Ctrl+G or Ctrl+X Ctrl+E | Open current prompt in $EDITOR. |
Ctrl+V (Cmd+V on iTerm2) | Paste image from clipboard as [Image #N]. |
Cmd+P / Meta+P | Model picker. |
Cmd+T / Meta+T | Toggle extended thinking. |
Shift+Enter or \+Enter | Multi-line entry. Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal. Elsewhere: /terminal-setup. |
Option-key shortcuts on macOS silently fail until you set Left/Right Option = Esc+ in your terminal profile (iTerm2, etc.). If Alt+M does nothing for mode cycling, that's why — use Shift+Tab instead.
The desktop app's shortcuts are not officially documented by Anthropic — what you see here is the CLI.
Claude Code's input line reads the first character as a mode signal:
| First char | Mode |
|---|---|
/ | Slash command — runs a command, not a prompt. |
! | Bash passthrough — runs shell, result enters your context. |
@ | File mention — @path/to/file attaches a file; @Explore mentions a subagent. |
# | Memory add — the text after # gets appended to the right CLAUDE.md. Claude picks the scope (project / user / local). |
| Anything else | Normal prompt. |
Use # when you catch yourself re-explaining the same rule. Use ! when you want Claude to see the output of a real command. Use @ when you want Claude to read a specific file without guessing.
The canonical memory docs live at code.claude.com/docs/en/memory ↗. The practical shape:
Under 200 lines per file. Official guidance. Beyond that, context usage grows and Claude follows the rules less reliably. Community consensus runs shorter — good CLAUDE.md files are often under 80 lines.
Put multi-step procedures in skills, not CLAUDE.md. Put path-specific rules in .claude/rules/*.md with a paths: frontmatter so they activate only when relevant.
All CLAUDE.md files from the current directory up to the filesystem root get concatenated at session start. Priority (later wins on conflict):
~/.claude/CLAUDE.md (about you, loads everywhere)./CLAUDE.md or ./.claude/CLAUDE.md (about the codebase, committed)./CLAUDE.local.md (about you in this project, gitignored)Subdirectory CLAUDE.md files load lazily when Claude reads a file inside. Useful for monorepos.
Project (./CLAUDE.md):
# Project
Internal onboarding tool. Postgres + Node, Vercel deploy.
## Conventions
- TypeScript strict. No `any` unless commented.
- Tests next to source: `foo.ts` + `foo.test.ts`.
- Migrations: numbered SQL files in `db/migrations/`.
## Don't
- Don't install npm packages without asking.
- Don't touch `app/legacy/`.
## Commands
- `pnpm dev`, `pnpm test`, `pnpm db:seed`
User (~/.claude/CLAUDE.md):
# Personal
Prefer direct answers. No throat-clearing.
I use vim keybindings in my editor.
When I say "ship it", run tests first, then commit.
Local (./CLAUDE.local.md, gitignored):
# Local notes
Staging DB: `postgresql://localhost:5433/app_staging`
WIP branch: `wip/2026-04-refactor-auth`
@path/to/file.md expands inline — useful but the imported file still counts against context, it loads at session start. Max depth 5 hops. Don't use imports to "save context" — they don't.
This is a lightweight overview. Anthropic's current privacy and trust pages are the source of truth; links are below.
Every prompt sends: your message, files you explicitly share (via @, tool use, or what Claude reads to answer), and conversation history in the current context window.
It does not send: your full filesystem, files outside the project, anything matched by .gitignore or .claudeignore.
| Plan | Audience | Retention posture |
|---|---|---|
| Pro | Individual | Standard retention; used to improve service; opt out in console settings. |
| Max | Heavy individual | Same as Pro. |
| Team | Small orgs (5-200 seats) | Admin-configurable. Stricter defaults than Pro. |
| Enterprise | Large orgs | Zero-retention available. Admin pushes policy. SSO, SOC 2, DPA. |
| API direct | Developers, some features blocked | Retention policy set by you in API console; Remote Control, mobile app, and team features typically locked out. |
If your company has a Team or Enterprise seat, use it. The retention and admin-policy differences matter for corporate use.
.claudeignoreThe simplest defence regardless of plan. Next to .gitignore, lists files or paths Claude never sees:
.env
.env.*
**/secrets.*
customer-data/
proprietary-algorithms/
Use it for secrets, customer data, internal docs — whatever your compliance posture requires.
MCPs that fetch untrusted content (web pages, issues, emails) can inject instructions into your session. Anthropic's stance: third-party MCPs at your own risk. Review what an MCP does before installing. Prefer first-party MCPs from anthropics/ organisations when available.
If you're unsure what your organisation's policy allows, talk to your admin before touching production code with Claude.
The Agent Skills open format — spec and reference implementations:
skill-creator and mcp-builder meta-skillsChapter 6 shows the agentic skill-authoring workflow (invoke skill-creator or craft-skill, answer discovery questions, review the draft).
Plugin manifest format, marketplace submission, plugin-vs-skill distinction:
Shell commands, HTTP endpoints, or LLM prompts fired at specific lifecycle events. Events include SessionStart, PreToolUse, PostToolUse, FileChanged, Stop, PreCompact, and many more.
.claude/settings.json under "hooks", or in a plugin's hooks/hooks.jsonBuild custom MCP servers with the MCP SDK (Python or TypeScript):
mcp-builder skill in anthropics/skills scaffolds oneEvery official link referenced across this guide, in one place.