What it does
Claude Code runs long-lived tasks—code generation, testing, workflows, agent orchestration. Sometimes you need to stop one mid-flight without nuking your whole session or losing uncommitted work. That's where Double-Esc comes in.
Press Escape once, and Claude Code sends a graceful cancellation signal to the running task. The model stops generating, any in-flight tool calls abort cleanly, and you return to the prompt. Press Escape a second time within ~1 second, and the interrupt becomes forceful—it kills the task immediately without waiting for cleanup.
This is distinct from Ctrl+C in the terminal, which kills the entire Claude Code process (losing session state), and from a single Esc in some UIs (which just closes a modal). Double-Esc is the "stop this one task" lever.
When to use it
- A code generation is spinning through 50 files when you only needed 5—stop it, refine your prompt, try again.
- An agent is running in circles or hallucinating—interrupt before it wastes tokens, then redirect.
- A workflow spawned too many parallel jobs and you want to bail out—Double-Esc stops the entire fan-out.
- A
npm runorgit pushis hanging—instead of Ctrl+C (which kills Claude Code), press Esc once to cancel the subprocess gracefully, then decide your next move.
The key insight: Single Esc stops this task; Ctrl+C stops Claude Code itself. Double-Esc is the middle ground—it lets you interrupt without losing your work or session.
Try it yourself
Start any long-running task: a npm run build, an agent research prompt, or a workflow. Halfway through, press Escape once and watch the task wind down gracefully—you'll see "Interrupted by user" or similar. If that's too slow, press Escape again within a second to force-kill it.
Gotchas
- Timing matters. The second Esc must land within ~1 second of the first, or it registers as a new input. If you wait 5 seconds between presses, the second Esc won't trigger force-kill—it'll just be a stray keystroke.
- Background tasks still run. If you interrupt a workflow with background agents (spawned with
run_in_background: true), those agents keep running in the cloud. Double-Esc stops the orchestrator locally, not the remote work. Check/workflowsto see and kill background tasks explicitly. - Dirty state on force-kill. A graceful Esc allows the model to finish streaming partial output and any cleanup work. A second Esc cuts it off—you may lose the tail of a response. Use single Esc first; only go double if the first isn't working.
- Not Escape on macOS. On some terminals, the Escape key is remapped. Check your keybindings config (
~/.claude/keybindings.json) if Double-Esc isn't responding—you may need to rebind it to a different key combo.
Try it yourself
Type the command in the fake terminal. Nothing leaves your browser.