Quick Claude Code Tips I Wish I Knew Earlier
I’ve been using Claude Code daily for a while now. Most of these tips I stumbled onto by accident or found buried in docs after wondering “there has to be a better way.”
Escape Hatch: Double Escape
When Claude is mid-response and going in the wrong direction, hit Escape twice fast. It stops generation immediately. Saves you from watching Claude write 200 lines of code you’re about to delete.
I use this constantly. The moment I see it heading somewhere wrong, double-tap and redirect.
Compact Mode Exists
If you haven’t tried /compact, you’re missing out. It summarizes the conversation so far into a much shorter version, freeing up context. Useful when you’ve been going back and forth and the context is getting bloated.
The tradeoff: you lose some nuance. But if you’re 50 messages deep into debugging something, a lot of that context is noise anyway.
Resume Where You Left Off
claude --resume picks up your last conversation. claude --continue does the same but doesn’t wait for input — it just keeps going from where it stopped.
I use --resume when I step away and come back. I use --continue when Claude was mid-task and I had to kill the terminal for some reason.
Review Mode for Pull Requests
claude review is built specifically for code review. Point it at a PR and it’ll analyze the changes. I use this before reviewing PRs myself — it catches things I’d miss and gives me a head start.
The Slash Commands You’ll Actually Use
/clear — Wipes the conversation. Fresh start without exiting.
/cost — Shows token usage and cost so far. Useful when you’re burning through a long session and want to know where you stand.
/doctor — Checks if your setup is healthy. Good for debugging when things feel off.
/memory — Opens your CLAUDE.md for editing. Faster than finding the file manually.
Headless Mode for Scripts
claude -p "your prompt here" runs Claude without the interactive interface. Prints the response and exits. Perfect for scripts, CI pipelines, or when you just want a quick answer without starting a session.
Combine with --output-format json if you need to parse the response programmatically.
The Vim Mode Nobody Talks About
Ctrl+X Ctrl+E opens your current prompt in your default editor. So if you’ve got a long, multi-line prompt you’re crafting, you can edit it in vim (or whatever you’ve got set) instead of fighting with the terminal.
This one changed how I write complex prompts.
Model Switching
You can switch models mid-conversation with /model. Sometimes I start with Sonnet for speed, then switch to Opus when I hit something that needs more horsepower.
Also, claude --model opus or claude --model sonnet if you want to start with a specific model.
Kill Runaway Commands
If Claude kicks off a command that’s taking forever or looks wrong, Ctrl+C cancels it. Claude will acknowledge the cancellation and ask what to do instead.
Don’t just sit there watching a test suite run for 10 minutes when you realized you wanted a different one.
The @-Mention Shortcut
In your prompts, you can use @filename to reference files. Claude expands it to the full path and pulls the file into context. Faster than typing out paths, and it autocompletes.
Works for folders too. @src/routes/ pulls in that whole directory structure.
Output Directly to Files
claude -p "write a Python script that..." --output-file script.py generates and writes directly to a file. Skips the copy-paste dance when you just want the code.
Check What’s in Context
/context shows you what files and information Claude currently has loaded. When things aren’t working the way you expect, check this. Often the issue is Claude’s missing a file you thought it had.
None of these are game-changers on their own. But stacked together, they’ve probably saved me hours. The double-Escape trick alone was worth the price of admission.