分享10个你可能不知道的Claude Code隐藏命令 (English)
分享10个你可能不知道的Claude Code隐藏命令 (English)
Generated: 2026-06-24 10:47:51
---
You won't believe it! The other day at the office, I saw a coworker who had been using Claude Code for three hours straight, completely rewriting a project. I walked over and spotted a clear mistake in his Prompt.
I said, "Why don't you just roll it back?"
He froze. "What's rollback?"
I nearly jumped out of my chair on the spot. I yelled across the office, "Raise your hand if you know double-tapping Esc rolls back code!" Out of seven or eight people, one hand slowly went up.
Can you believe it?! A guy who uses Claude Code every single day had no idea where the undo button was.
That gets me going. This thing updates so fast, a developer in Japan wrote a whole article complaining: it updates while you're at work, it updates while you're asleep. What's worse, some new features never even make it into the changelog—I only found out because someone on the dev team casually mentioned it on Twitter.
So today, I'm sharing all the hard-earned tricks I've actually used. This isn't some massive tutorial—just ten commands that have proven themselves in my daily workflow. I guarantee you'll want to try the first one the moment you finish reading it.
---
一、/btw — Sneak in a Question While Coding
Not long ago, the Claude Code lead posted about this command on Twitter, and it got a ton of attention. That alone tells you how much people wanted it.
/btw stands for "by the way." Just like the name says, it's a casual aside.
Imagine this: Claude is mid‑rampage, refactoring a huge module. You've been chatting for dozens of rounds, the context window is bulging. Suddenly you remember something—"Hey, where did I put that test file again?"
Back in the old days, you'd just ask right in the chat. Claude would stop, answer you, and now there's a completely irrelevant chunk of conversation in the window. When it gets back to work, it's already lost its train of thought. That's what we call context pollution—anyone who's used it for a while has been burned by it.
Now with /btw, while it's working you just type:
/btw What's the crawling flow for this project? Give me a quick overview.
Hit space, type your question, send. Claude will answer, but that answer never enters the main conversation. Two threads run in parallel without interfering. Once you've read the answer, press Enter and the temporary chat disappears.
Here's the killer part: /btw reuses your current prompt cache, so asking barely costs extra tokens. Freebies!
My current routine: while Claude is writing code, if a question pops into my head, I just sling a /btw over. I don't have to wait for it to finish, and I don't pollute the context. It's become my most‑used command, no contest.
---
二、Double‑Tap Esc — The Undo Button (And It's Addictive)
If /btw is the productivity booster, double‑tap Esc is the "undo" button in the AI world.
There's always been a pain point: what if the AI makes a mess? You may have heard of the /rewind command, but personally, I prefer double‑tap Esc—press the Escape key twice in quick succession. A menu pops up, and it has a brilliantly clever design: you can choose to roll back only the code, or roll back both the code and the conversation.
That mistake my coworker made—three hours of code ruined? If he'd just double‑tapped Esc and rolled back the code, it would have been fixed. And Claude remembers that the previous approach failed, so it won't make you explain the whole requirement from scratch again.
After rolling back, just say, "Okay, let's try a different direction."
If you choose to roll back only the code, the conversation history and the requirements are still there. Only the code returns to its state before the change. When you discuss the new direction, Claude fully understands the context. No need to waste time re‑explaining.
The counter‑intuitive part: most people think rolling back wipes everything, but you can roll back just the code while keeping the conversation intact. If you don't know that, you're missing out big time.
---
三、/insight and Hook — One Gives You a Report, the Other Stops You Before You Mess Up
I debated whether to put these two together. One is proactive, the other reactive, but they complement each other perfectly.
/insight generates a report of your Claude Code usage over the past month, output as an HTML file. When I opened it in the browser, I was honestly surprised—the report shows your most frequently used commands ranked, which actions are highly repetitive, and even recommends custom commands or ready‑made Skills you could use.
After reading the report, I noticed something: every time I write a TypeScript workflow, my operations follow almost the exact same pattern. Turns out all that could be packaged into a Skill and reused directly.
But the problem is, I'm lucky if I remember to run /insight once a month. That's where Hook comes in.
What is Hook? Think of it as a conditional trigger: when a specific event happens, automatically execute a certain action.
I've set up two Hooks that I find especially useful:
The first: when the number of tool calls in a single conversation exceeds 8, automatically output optimization suggestions and have Claude teach me how to condense that chain of operations into a Skill.
In other words, when I keep doing the same kind of complex operation over and over, the system reminds me, "Hey, maybe you should turn this into a reusable routine."
The second: when it detects that I've typed a large chunk of unorganized requirements, pop up a reminder to tidy them up before sending.
When I first started using Claude Code, I had this stupid habit: whatever came to mind, I'd just spew it out via voice input—basically verbal garbage. The AI would misunderstand, and we'd go back and forth for ages. After I set up this Hook, every time I'm about to dump a huge block of information, it says, "Please structure your requirements first." My efficiency shot up.
You can test Hooks in a single project folder first, then expand to global settings.
Summing up: one is post‑mortem analysis, the other is a pre‑emptive reminder. With both working for you, even if you wander down the wrong path, someone will pull you back.
---
四、/export — Your Second Brain
This command looks so simple it almost feels trivial, but I've found it way more important than it seems.
/export dumps the entire conversation into a Markdown file.
What's that good for? Let me give you two scenarios.
First: you've spent half an hour with Claude discussing an architecture plan, with tons of reasoning, decision logic, even your agonizing over which alternative to pick. If you don't save that, next week you'll have forgotten why you chose A over B. Export to Markdown, archive it—when you review later, one glance saves you a ton of time.
Second: you can feed the exported Markdown directly to another AI tool for further analysis. I once wrote a project proposal inside Claude Code, exported it, and handed it to Codex for the actual code generation. It's the perfect handover document for cross‑tool collaboration.
Seriously, a lot of people chat and then close—it's like the conversation never happened. The thinking process is lost, and next time you start from zero. /export is a light you leave for your future self.
---
五、Keyboard Shortcuts Cheat Sheet — Fingers Faster Than Brain
We've been talking about commands, but some operations are even faster with keyboard shortcuts. I started out clicking everything, but later
Cael Lee
Full-stack developer with 8+ years of experience. Currently building AI-powered developer tools. I've tested 20+ AI API providers and coding assistants.