Claude Sessions and Context
Keyboard
| Key | Action |
|---|---|
Ctrl+C | Interrupt; with nothing running, first press clears the prompt, second exits |
Ctrl+D | Exit (press twice) |
Ctrl+L | Redraw the screen (keeps conversation) |
Ctrl+O | Transcript viewer (detailed tool usage) |
Ctrl+R | Reverse-search history |
Ctrl+B | Background running Bash commands and agents |
Ctrl+T | Toggle Claude's task checklist (/tasks for background work) |
Ctrl+G / Ctrl+X Ctrl+E | Edit the prompt in your external editor |
Shift+Tab (Alt+M on some Windows setups) | Cycle permission modes |
Option/Alt+P | Switch model without clearing the prompt |
Option/Alt+T | Toggle extended thinking (no effect on Opus/Sonnet/Haiku 5.5 or Fable, which always think) |
Esc | Interrupt Claude or close a dialog |
Esc Esc | Clear the typed draft; on an empty prompt opens the rewind menu |
Session Commands
| Command | Purpose |
|---|---|
/resume [session], claude -r "name" | Pick up a past session by ID or name |
claude -c | Continue the latest conversation in this directory |
claude --resume <id> --fork-session | Branch into a new session ID, original untouched |
/rename [name] | Name the session (auto-generated if omitted); claude -n name at launch |
/rewind (alias /checkpoint) | Restore code and/or conversation to an earlier point |
/clear [name] | New empty conversation (CLAUDE.md and auto memory stay); the name labels the old one in /resume |
/compact [instructions] | Summarize to free tokens (also automatic) |
/context [all] | Context usage grid plus optimization hints |
/autocompact [auto|500k] | Set how full the window gets before auto-compact |
/usage | Session cost, plan limits and activity stats. /stats and /cost are aliases |
/btw question | Side question without adding to the conversation |
/export [file] | Conversation as plain text (clipboard or file) |
/voice [hold|tap|off] | Voice dictation (needs a claude.ai account; WSL2 needs PulseAudio) |
/config → Editor mode | Vim keybindings (editorMode). The /vim command was removed in v2.1.92 |
/cd path, /add-dir path | Move the session / add a working directory |
/tasks | Background work (subagents, shells, MCP calls); t teleports into a cloud session |
/debug, claude --debug | Debug log; --debug-file <path> writes it where you choose |
/exit | Quit |
Commands only run at the start of a message; text after them is arguments. A command sent while Claude is working is queued (except /status, /tasks, /usage). Up to six skills can be chained: /skill-a /skill-b do X.
Context Window
- Window = input + output tokens. 1M by default on Fable 5.x, Sonnet 5+, Haiku 5.5 and Opus 4.7+; 200K on Opus 4.6 / Sonnet 4.6 unless you use
[1m]. Unknown model IDs assume 200K.CLAUDE_CODE_DISABLE_1M_CONTEXT=1turns 1M off. - Auto-compact buffer is reserved so there's room to summarize; on 1M models it triggers around 967K. Tune with
/autocompact 500k,autoCompactWindow, orCLAUDE_CODE_AUTO_COMPACT_WINDOW(100K–1M). - Switching to a smaller window loses information.
- CLAUDE.md fully survives
/compact(re-read from disk).
Where Things Live
~/.claude/projects/<folder-path>/ # one project per directory you run claude in
├── <session_id>.jsonl # one transcript per session
└── memory/ # auto memory
cleanupPeriodDays (default 30, minimum 1; 0 is rejected) deletes old session transcripts in a background sweep after a session starts, and they then vanish from /resume.
Session types: Local (terminal) and Web (remote); Remote Control sessions can continue locally.
~/.claude.json is legacy; use ~/.claude/settings.json.
Related: Claude Memory, Claude Setup and Billing, Claude Settings