How to stop a runaway Claude Code chat
You give Claude Code a big job and walk away. When you come back, it has been going the wrong way for an hour and your 5-hour limit is gone. Here is what you can do about it.
With Claude Code alone
- Stop it yourself. Esc stops the current response. Claude keeps the work done so far, and you can point it somewhere else.
- Look at the meter.
/usageshows the session's cost and your plan's limits. - Limit a scripted run.
claude -p --max-turns 3 "your request"stops after that many turns, and--max-budget-usdstops at an estimated spend. Both work only in print mode, so they do not help with a chat you are having.
All of these need you, or a script you planned ahead. None of them catches an ordinary chat that keeps going while you are away.
In Codepit
- A guard that pauses and asks. One turn that works past 90 minutes, or uses 30% of your 5-hour limit by itself, pauses before its next step and asks: keep going, or stop. Keep going doubles those limits for that turn.
- It does not wait for ever. With no answer in 10 minutes the chat stops by itself, with a quiet mark rather than an error.
- It knows what not to stop. The night shift has its own budget, and tasks from your other computers keep running.
- Yours to change. It is on by default. The switch is Stop a chat that runs away in Settings › General › Chats.
- The meter is always there. Click Plan on the status bar to see your 5-hour window, the week and how full the chat is.
- It tells you. When a chat waits for your OK, asks a question, stops or finishes a long job, your system tells you, and the iPhone app can too.
More guides
How to review Claude Code's changes, line by lineIts own prompts, git and /rewind, or Keep and Undo on each change.
The same Claude Code chat on two computersReach a chat from your other computer, or move it there with your code.
How to use Claude Code from your iPhoneFollow a job, answer a question or allow a command away from your desk.
How to find and keep old Claude Code chatsChats are deleted after 30 days without a word. Keep them and search them.
What this page says about Claude Code was checked against its documentation on 3 November 2026.