Plan first, interrupt or rewind when it drifts, and keep the context window under control.
1 / 3
Just ask, or plan first
If you know what you want, just ask. When the approach is unclear, the change spans many files or the code is new to you, switch to plan mode (Shift+Tab) first: Claude proposes a plan without editing anything, and you correct it before you approve.
2 / 3
Esc and /rewind
Press Esc to interrupt and redirect it at any time. Each prompt you send is a checkpoint: /rewind restores the code, the conversation or both. Changes outside the files it edited, such as data in a database, can’t be rewound.
3 / 3
The context window
Messages, files read, command output and Claude’s replies all share one context window. When it fills up, Claude Code compacts older turns into a summary, losing some details. Add a focus, like /compact focus on the discount bug, to choose what the summary keeps, or /clear before an unrelated task. Big side jobs can go to a subagent instead, coming up next.