When Claude gets stuck
Spot the signs and get back on track
⏱ Est. ~7 min
01 · Read
Sometimes Claude Code doesn't do what you expect. It might edit the same file three times without making progress, add code you didn't ask for, or seem to forget what you said earlier.
That's normal. It doesn't mean Claude is broken or you're doing anything wrong. It means you need to spot the problem and recover.
Think of it like a GPS that keeps recalculating the same wrong route. Telling it to "try again" doesn't help — you need to pull over, clear the destination, and re-enter it. Claude Code works the same way.
Here are the most common signs Claude is stuck: - Going in circles — repeatedly trying the same approach, making similar edits - Scope creep — starting to edit files or add features you didn't ask for - Forgetting context — contradicting what it said earlier, or redoing finished work - Wrong target — editing the wrong file or fixing a problem that doesn't exist
02 · Quiz
Claude has edited the same function three times in a row, each producing a slightly different version. What's most likely happening?
- Claude is carefully refining the code to perfection
- Your computer is too slow and Claude can't keep up
- The function is too complex for Claude to handle
- Claude is stuck in a loop — it needs a reset or clearer direction
03 · Read
Claude Code has two built-in commands for when things go sideways:
/clear — Wipes the entire conversation and starts fresh. Use this when the conversation has drifted so far off that adding more context won't fix it. It's like closing all browser tabs and starting over.
/compact — Compresses the conversation history, keeping the important context and freeing up room. Use this when Claude's context is running low (you've been at it a while) but the overall direction is still right.
The key difference: /clear is a full reset. /compact is a trim. Use /clear when Claude is confused about what to do; use /compact when Claude has no room to think.
04 · Fill in the blank
To completely reset a Claude Code conversation that's gone off track, type /___.
05 · Match
Match each problem to the best recovery action.
(This section is interactive — please enable JavaScript.)
06 · Checklist
When Claude produces something wrong, follow the "stop, undo, rephrase" flow before trying again.
- Stop — don't let Claude keep going in the wrong direction
- Undo — use git diff to see what changed and undo if needed
- Rephrase — write a clearer, more specific prompt
- Consider /clear if the conversation has drifted too far
07 · Read
The best way to deal with a stuck Claude is to prevent it in the first place. These work well: - Small prompts — one change at a time, don't pack five into one message - Be specific — "Add validation to the email field in ContactForm.tsx" beats "add validation" - Say what NOT to do — "Don't change existing tests" or "Leave the database schema alone" - Check often — look at git diff after every change, don't wait until 10 changes deep
Getting stuck isn't a failure. It's a normal part of working with AI tools. The engineers who get the most out of Claude Code aren't the ones who never get stuck — they're the ones who recover fastest.
08 · Quiz
Claude Code has been working a long time and is starting to forget instructions you gave earlier in the conversation. The overall direction is still right, but it's running low on room to think. What should you do?
- Type /compact to compress the conversation history and keep context
- Type /clear to wipe everything and start over
- Close the terminal and reopen it
- Keep repeating your instructions until Claude remembers
09 · Fill in the blank
When Claude makes a mistake, follow the three-step recovery: stop, _____, rephrase.
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.