Skip to main content
Prompting

Power Tips: Hidden Shortcuts and Commands

Ultrathink, Esc Esc, /rewind, /compact: the advanced shortcuts and techniques Claude Code power users rely on every day.

The shortcuts nobody tells you about

Claude Code is packed with hidden features that fundamentally change how you work. These shortcuts and commands aren't always prominently documented, but power users rely on them daily.

This page gathers the most useful techniques, tested and validated by the team that built Claude Code.

Controlling thinking depth

ultrathink and its variants

When Claude Code faces a complex problem (architecture, multi-file debugging, tricky refactoring), you can ask it to think more deeply by adding keywords to your prompt:

KeywordEffectWhen to use
thinkExtended standard thinkingModerately complex questions
think harderDeep thinkingProblems with multiple possible solutions
ultrathinkMaximum thinkingArchitecture, complex debugging, critical decisions
megathinkSame as ultrathinkYour pick
# Complex debugging
"ultrathink: why does this test pass locally but fail in CI? Here's the error log..."
# Architecture decision
"think harder: we need to choose between Redis and an in-memory cache for this use case. Here are the constraints..."

Extended thinking (thinking mode)

Thinking mode forces Claude to show its reasoning before answering. You can enable it:

  • In settings.json: "alwaysThinkingEnabled": true
  • With the AltT shortcut during a session
  • With the --thinking flag at launch

Navigating the conversation

Esc Esc: graceful interrupt

When Claude Code heads in the wrong direction or takes too long, press EscEsc twice:

  • First Esc signals the interruption
  • Second Esc confirms the stop

Claude stops cleanly and gives you back control. You can then rephrase your request or adjust course.

/rewind: go back in time

When a response doesn't work out, instead of asking "no, try again," use /rewind:

# Go back one turn (removes the last response + your last message)
/rewind
# Go back 3 turns
/rewind 3

It's cleaner than correcting in the same context: it frees up context window space and starts from a clean state.

/branch: fork the conversation

When you want to try two different approaches without losing your work:

/branch

Claude creates a copy of the conversation. You can explore approach A in the main session and approach B in the fork.

Managing the context window

/compact: compress before it's too late

The golden rule: manually compact at 50% of the context window. Don't wait for Claude Code to do it automatically (it kicks in around 95%, when quality has already dropped).

/compact

Compaction summarizes the conversation to free space while keeping the important context.

/rename and /resume: keep your sessions

For long or important sessions:

# Name the current session
/rename "refactoring auth module"
# Later, resume this session
claude -c # resumes the last session
/resume # lists available sessions

Advanced prompting techniques

"Grill me": get challenged

Instead of merging right away, ask Claude to challenge your code:

"Grill me on these changes and don't make a PR until I pass your test"

Claude will:

  1. Review all the changes
  2. Ask pointed questions about edge cases
  3. Identify weaknesses
  4. Only approve when your answers are solid

It's like having a demanding reviewer available 24/7.

"Scrap this": start fresh, but smarter

When a fix becomes a patch on top of a patch:

"Knowing everything you know now, scrap this and implement the elegant solution"

Claude keeps the context of what DIDN'T work and proposes a clean approach. Much better than micro-fixing broken code.

Paste a bug and say "fix"

No need for an elaborate prompt. Paste the error or the Slack thread and say:

"fix"

Claude reads the context, identifies the problem, and fixes it. No micro-management needed.

Ask for ASCII diagrams

To understand a complex architecture:

"Draw an ASCII diagram of this project's architecture"

Claude produces a text diagram right in the terminal, often faster than any diagramming tool.

Useful keyboard shortcuts

ShortcutAction
EscEscGracefully interrupt Claude
CtrlCCancel the current response
ShiftTabToggle modes (normal, plan, auto-accept)
AltTToggle thinking mode
FnFnActivate voice dictation (macOS)
/Open slash command list

Lesser-known slash commands

CommandPurpose
/btwAsk a quick question without interrupting the current task
/renameName the session for easy retrieval
/resumeResume a saved session
/rewindGo back N turns
/branchFork the conversation
/compactManually compact the context
/statuslineDisplay real-time info (context, model, cost)
/voiceSwitch to voice dictation mode

Next steps