# Claude Code Cheat Sheet: Commands, Shortcuts, and Quick Reference

Claude Code ships with 30+ slash commands and 10+ keyboard shortcuts, yet most developers stick to the same five or six. This reference organizes every command by workflow, explains the three permission modes that control agent autonomy, and covers advanced features like hooks, effort levels, and MCP connections that most cheatsheets skip.

Source: https://fast.io/resources/claude-code-cheat-sheet-quick-reference/
Last reviewed: 2026-06-30

## Why a Claude Code Quick Reference Matters

Claude Code now accounts for roughly 4% of all GitHub commits, according to 2026 usage tracking data. With that level of adoption, the gap between a developer who knows `/compact` and one who doesn't is the gap between hitting context limits mid-task and finishing cleanly.

The official Anthropic cheatsheet lists commands alphabetically, which works for lookup but not for building habits. This guide reorganizes everything by workflow: session management, context control, code operations, and external tools. Whether you run Claude Code for solo sessions or Claude Cowork collaboration across agents, knowing the command surface turns exploratory fumbling into focused work.

To see every command available in your current session, type `/` on an empty prompt. The autocomplete menu shows built-in defaults, custom skills, plugin commands, and tools from connected MCP servers. Your list will vary depending on what you've installed.

## Every Slash Command, Organized by Workflow

### Session and Navigation - `/help` lists all available commands
- `/status` shows your account, active model, working directory, and version
- `/clear` wipes conversation history and starts fresh (project memory stays)
- `/resume` reopens a previous session to continue where you left off
- `/login` and `/logout` handle authentication and account switching
- `/exit` quits the CLI

### Context Management

Context is the most common bottleneck in long sessions. These commands keep you under the limit:

- `/compact` summarizes the conversation to free up context window space
- `/context` shows what's currently loaded in the context window
- `/cost` displays token usage and spend for the session
- `/usage` shows plan limits and current rate-limit status
- `/btw` asks a quick side question without adding to the main thread

### Code and File Operations

- `/init` explores your codebase and generates a starter `CLAUDE.md`
- `/diff` opens an interactive viewer of uncommitted changes and per-turn diffs
- `/plan` enters Plan Mode, optionally with a task description
- `/simplify` runs parallel review agents to check recent changes for quality issues
- `/add-dir` grants file access to an additional directory for the session
- `/rewind` rolls the conversation and code back to an earlier checkpoint

### Configuration - `/model` shows or switches the active model (Opus, Sonnet, Haiku, Fable)
- `/config` opens settings for theme, defaults, and editor mode
- `/permissions` views or changes which tools need approval before running
- `/memory` opens `CLAUDE.md` files in scope for editing
- `/hooks` shows hook configuration for tool events

### External Tools and Agents

- `/mcp` manages MCP server connections and authentication
- `/agents` lists, creates, or edits subagents
- `/skills` lists available skills in the session

### Output and Diagnostics

- `/copy` copies the last response or a code block to clipboard
- `/export` saves the conversation to a file or clipboard
- `/feedback` reports an issue to Anthropic with session context
- `/doctor` diagnoses install and environment problems

## Best Keyboard Shortcuts for Claude Code Sessions

These work in the Claude Code CLI. Terminal support varies, so press `?` in any session to see what's available in your setup.

**Interrupting and navigating:**

- `Esc` interrupts Claude mid-response so you can type again
- `Esc, Esc` (double-tap) opens the rewind and checkpoint menu
- `Ctrl + C` cancels the current input, or exits on an empty prompt
- `Ctrl + R` reverse-searches through your prompt history
- `Up / Down arrows` scroll through previous prompts

**Display and modes:**

- `Ctrl + O` expands to the verbose, full transcript view
- `Shift + Tab` cycles permission mode: default, acceptEdits, plan
- `?` shows shortcuts available in your terminal or IDE

**Input helpers:**

- `@` followed by a path references a file or directory in your prompt
- `/` on an empty line opens the command menu with autocomplete

`Shift + Tab` deserves special attention. Instead of typing `/plan` to enter plan mode, one keystroke cycles through all three permission modes. In `acceptEdits` mode, Claude auto-approves file writes without prompting. In `plan` mode, Claude explores and proposes but won't execute. Cycling back returns to default, where each action requires approval.

## How Permission Modes and Effort Levels Control Agent Autonomy

Claude Code's three permission modes control how much autonomy the agent has:

**Default mode** asks for approval on file edits and tool calls. This is what you get when you launch `claude` without flags.

**Accept Edits mode** auto-approves file writes for the rest of the session. Good for refactoring sessions where you trust the direction but don't want to approve every save. Switch with `Shift + Tab` or configure as a default in `/config`.

**Plan mode** puts Claude in read-only exploration. It reads files, searches code, and proposes changes, but executes nothing. Start here when diagnosing a bug or exploring unfamiliar code. Enter with `/plan` or cycle to it with `Shift + Tab`.

### Effort Levels

The `/effort` command controls how much reasoning Claude applies per response:

- `low` keeps responses short and fast for simple lookups
- `medium` balances speed and depth (the default)
- `high` adds deeper analysis for complex questions
- `xhigh` and `max` enable extended thinking for multi-file architectural problems
- `auto` lets Claude pick based on the prompt complexity

Higher effort uses more tokens but produces better results for debugging and multi-step refactoring. For quick "where is this function defined?" questions, `low` is enough.

## Memory, Hooks, and Claude Cowork Session Persistence

### CLAUDE.md and Project Memory

`CLAUDE.md` is a markdown file Claude reads at the start of every session. Place one in your project root with coding conventions, file structure notes, or patterns to avoid. Use `/memory` to edit it, or `/init` to generate a starter file from your codebase.

Claude Code also maintains auto-memory across conversations, saved to `~/.claude/projects/<project>/memory/`. Corrections you make in one session carry forward automatically, which is especially useful in Claude Cowork sessions where multiple agents share context about the same codebase.

### Hooks

Hooks are shell commands that fire at specific points in Claude's lifecycle. Define them in `settings.json`:

- `SessionStart` loads context when a session launches
- `PreToolUse` runs before tool execution (good for logging bash commands)
- `PostToolUse` runs after (useful for auto-formatting saved files)
- `Stop` runs checks when Claude finishes a task
- `PostCompact` re-injects critical instructions after context compression

### Skills and Subagents

Skills are packaged instructions for specific workflows. Store them at `.claude/skills/<name>/SKILL.md` and invoke as slash commands. Custom agents live in `.claude/agents/` and launch with `claude --agent=<name>`.

Subagents handle focused subtasks in their own context. For parallel work, set `isolation: worktree` in agent frontmatter to give each subagent its own git worktree.

## Connecting Claude Code to External Tools with MCP

The `/mcp` command manages connections to external services through the Model Context Protocol. MCP servers extend what Claude Code can do beyond file editing and bash:

```
claude mcp add <server-name>
```

Common servers include GitHub (issues and pull requests), Sentry (error tracking), and database connectors. Each server exposes tools that Claude calls during a session.

For workflows that produce artifacts like research, generated documentation, or data exports, files can end up scattered across local directories with no easy way to share them. [Fast.io workspaces](https://fast.io) solve this through an MCP server at `mcp.fast.io` that gives Claude Code agents persistent, searchable storage. Files uploaded during one session stay indexed and available in the next. An agent can build a workspace, organize output, and [transfer ownership to a human](/product/ai/) when the work is done.

To connect:

```
claude mcp add fastio /storage-for-agents/
```

The MCP approach keeps your agent's capabilities modular. Add servers as you need them, remove what you don't. Type `/mcp` to see active connections and manage authentication.

## Frequently asked questions

### What are the most useful Claude Code commands?

The five most-used commands for daily development are `/compact` (free up context), `/diff` (review changes), `/plan` (explore without executing), `/rewind` (roll back mistakes), and `/btw` (ask side questions without polluting the main thread). Type `/help` to see your full command list.

### What keyboard shortcuts does Claude Code support?

Claude Code supports 10+ keyboard shortcuts. The most important are `Esc` to interrupt a response, `Shift + Tab` to cycle between permission modes, `Ctrl + R` to search prompt history, and `@` followed by a file path to reference files in your prompt. Press `?` in any session to see which shortcuts work in your terminal.

### How do I see all commands in Claude Code?

Type `/` on an empty prompt to open the command menu with autocomplete. This shows every available command, including built-in defaults, custom skills, plugin commands, and MCP-provided tools. You can also run `/help` for a full list or `/skills` to see available workflow skills.

### What is plan mode in Claude Code?

Plan mode is a read-only mode where Claude explores your codebase, reads files, and proposes changes without executing anything. Enter it with `/plan` or by pressing `Shift + Tab` to cycle through permission modes. Plan mode is useful for diagnosing bugs or exploring unfamiliar code because you review every suggestion before allowing execution.

### How do I manage context window limits in Claude Code?

Use `/compact` to summarize the conversation and reclaim context space. Check usage with `/context` to see what's loaded and `/cost` for token counts. For fresh starts, `/clear` wipes the conversation while keeping project memory intact. The `/btw` command also helps by routing side questions outside the main thread.

### Can Claude Code connect to external tools and storage?

Yes. The `/mcp` command manages connections to external services through the Model Context Protocol. You can add MCP servers for GitHub, databases, error trackers, and file storage platforms like Fast.io. Each server exposes tools Claude calls during a session, extending its capabilities beyond local files and bash.

## About Fast.io

Fast.io provides shared workspaces where people and AI agents work on the same files, with built-in semantic search and citation-backed chat over what they hold. Agents reach it through a remote MCP server at https://mcp.fast.io/mcp, a REST API at https://api.fast.io/current/, and a command line client published on npm as @vividengine/fastio-cli.
