The keyboard shortcuts that put Claude Code under tighter control

From slash commands and file targeting to interrupting agents and recovering unfinished prompts, these keyboard controls make Claude Code faster and easier to steer.

Claude Code’s prompt box is more than a place to type instructions; used well, it becomes the main control surface for the session. The most useful shortcuts let you interrupt the agent, call commands, point it at specific files, search earlier prompts and preserve a half-finished thought without leaving the keyboard. In Anthropic’s own documentation, these controls are presented as part of interactive mode rather than as optional extras, and third-party guides broadly agree that a small set of keys covers most day-to-day work.

The core idea is simple: the first character you type changes how Claude Code treats the rest of the line. A question mark on an empty prompt opens the built-in help panel, a slash brings up commands and skills, an at sign offers file-path completion and an exclamation mark switches to shell mode. Guides from both Anthropic and independent reviewers say these prefixes are the fastest way to move from plain chat into direct control of the tool.

That help panel is the easiest entry point for new users. Pressing “?” on an empty prompt reveals the available shortcuts, while typing it into a message that already contains text leaves it as a normal character. According to the published cheat sheets, this is the quickest way to discover controls such as Ctrl+S for stashing a draft, Ctrl+O for opening the transcript and Shift+Tab for cycling through permission modes.

The slash menu works in a different way. Typing “/” at the start of a prompt opens a filtered list of built-in commands, skills and extensions from plugins or MCP servers, and users can narrow the list as they type. That makes it practical for commands such as session management, diagnostics or other utility actions without needing to remember every name in advance. Several guides note that command completion is sensitive to position: the slash must begin the message to run as a command, although some implementations still suggest matches later in the line.

File targeting is one of the most valuable shortcuts in real work. Typing “@” followed by a few letters gives Claude Code a list of matching paths, which helps avoid both long file names and unnecessary searching. In practice, this is the cleanest way to direct the model to one exact file when reviewing code, checking a script or asking for a targeted explanation. Guides aimed at beginners and more advanced users alike describe “@file” as a central part of everyday prompting.

Shell mode, triggered by “!”, is more powerful and more delicate. Anything entered that way runs as a shell command rather than as an instruction for Claude to interpret first, and the output is then fed back into the session. Anthropic’s documentation and the supporting cheat sheets say this is useful when you want Claude to see the result of a command you ran yourself, but it also means the command is not subject to the same sandboxing as tool actions the agent performs on its own.

For interruption and recovery, the key distinction is between Esc and Ctrl+C. Esc stops Claude’s current response or tool call while keeping the progress already made, which makes it the safer choice when you want to redirect the agent. Ctrl+C, by contrast, clears the input when nothing is running and can exit the session if pressed again on an empty prompt. The published guides also note that cleared drafts can often be restored with the Up arrow, which reduces the risk of losing a prompt accidentally.

History and draft management are where the keyboard-only workflow starts to feel efficient. Ctrl+R searches older prompts, including material beyond the current working folder, while Ctrl+S stashes an unfinished draft and restores it later with the cursor position and input mode intact. The Up arrow still has a role for recent history, but Ctrl+R is more precise when you remember only a fragment of an earlier request. Anthropic’s documentation and the third-party references both describe these controls as part of the everyday rhythm of a Claude Code session.

There are also shortcuts for visibility and session control. Ctrl+O opens the detailed transcript view, where tool calls, timestamps and model information become visible, and Shift+Tab cycles through permission modes such as plan mode and auto-accept settings when those are available. That matters because it lets users move between cautious inspection and faster execution without changing the message they are composing. The wider shortcut guides also mention terminal conveniences such as Ctrl+W to delete back to the last space and Ctrl+_ to undo the last edit in the input box.

The practical lesson is that Claude Code rewards a small amount of memorisation. The shortcuts that matter most are not obscure terminal tricks; they are the controls that let you steer the agent loop, keep context tidy and avoid needless retyping. For most users, the best starting set is the help key, the slash command menu, file targeting, shell mode, interruption keys, prompt search and draft stashing. Once those become habit, the rest of the interface becomes far easier to manage.

Disclaimer: This content is intended for informational purposes only. Readers are advised to exercise their own judgement, conduct due diligence, or consult a qualified expert before acting on any information provided.