A single-file, interactive terminal for learning Claude Code — every command, flag, keyboard shortcut, and mode explains what it does when you run it. Built for people who'd rather learn the flow by using it than scroll through a wall of tables.
🖥️ Live demo: enable GitHub Pages on this repo (see Usage).
claude-code-cheatsheet.html is a standalone HTML file with zero dependencies (beyond a Google Fonts CDN call that degrades gracefully offline). Drop it anywhere, open it in a browser, and you get a working Claude Code terminal wired to the whole reference: click any command, flag, or shortcut and it "runs" in the terminal, printing exactly what it does. Browsing the docs is using the terminal.
Current for Claude Code v2.1.212 (July 2026).
- Live terminal — type or click any entry and it runs above, printing what it does. Real REPL behaviors:
Tabautocomplete,↑ ↓history,clearto reset. - Command palette — press
/orCmd/Ctrl+Kto search across every command, flag, and shortcut;Enterruns the match in the terminal. - "The flow of a session" — the six real workflow phases (first session → during a task → parallel → before you ship → between sessions → when something's wrong). Tap one and it plays that phase's commands in order.
- Simulated UI for the iconic bits —
/contextdraws the colored context grid,/modelshows the picker,Shift+Tabshows the permission-mode cycle, so you learn the feel, not just the name. - Full reference, all clickable — ~50 slash commands, ~35 CLI flags, keyboard shortcuts (general / editing / multiline / transcript), models & effort levels, permission modes, config files & paths, environment variables, and a vim-mode grid.
- Color-coded — commands, arguments, and flags are visually distinct.
- Warm-ink terminal aesthetic — easy on the eyes for late-night sessions.
- Accessible & responsive — keyboard-navigable, visible focus, respects reduced motion, works down to mobile.
- Fully offline after first load.
open claude-code-cheatsheet.html
# Python
python3 -m http.server 8080
# Node
npx serve .
Then visit http://localhost:8080/claude-code-cheatsheet.html.
Rename the file to index.html so it loads at the root URL, then enable Settings → Pages → Deploy from branch → main / root. Your cheatsheet goes live at https://<user>.github.io/<repo>/.
#the-commands-youll-reach-for-most
| Command | What it does |
|---|---|
/clear |
Start a fresh conversation, keep project memory |
/compact |
Summarize context to free up space |
/context |
See what's filling the context window |
/rewind |
Roll code + conversation back to a checkpoint |
/model |
Switch model and dial effort |
/diff |
Review uncommitted changes and per-turn diffs |
#context-management-quick-reference
Managing context well is the single biggest factor in consistent output — the most important category to know:
/clear # fresh start, project memory kept
/clear my-old-task # fresh start + label the old convo in /resume
/compact # summarize the conversation to reclaim tokens
/compact focus on api # summarize with focus instructions
/context # visualize what's using the window
/context all # expand the per-item breakdown
/rewind # roll code + chat back to a checkpoint
Esc Esc # same rewind menu, from an empty prompt
.
├── claude-code-cheatsheet.html # The cheatsheet (single file, self-contained)
└── README.md # This file
Reference reflects Claude Code v2.1.212 (July 2026). Command availability varies by version, plan, and platform, and the CLI ships updates frequently — run /release-notes in a session to see what's changed, and verify flags on your install with claude --help.
If a command is wrong, missing, or a flag has changed — PRs welcome. Keep it factual and sourced to the official docs at code.claude.com/docs.