# /stop Command

> It ends the background session you are in.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** /stop, claude stop, Stop a background session

## Think of it like

It is like you turn off the oven. You do not just walk out.

## Definition

/stop ends the background session you are attached to. The chat and any worktree it made are kept, so nothing is lost. It is different from leaving. /exit or the left arrow only leaves a background session, and it keeps working. A reply of just /stop to a session ends it in the same way.

## Example

Emma attaches to a background session and sees it has gone the wrong way. She types /stop, then starts a new one with a clearer prompt.

## Example code

```console
/stop
```

End this background session.

## Why it matters

A session that has gone the wrong way keeps using tokens until someone stops it.

## Common mistake

Typing /exit and thinking the session ended. It only leaves it, and the work goes on.

## Three principles

- **Ends the session.** Not just leaves it.
- **Keeps the chat.** And the worktree.
- **For background ones.** Where you are attached.

## Related terms

- [/exit Command](https://learn.benibix.com/term/ai/exit-command)
- [Background Session](https://learn.benibix.com/term/ai/background-session)
- [/background Command](https://learn.benibix.com/term/ai/background-command)
- [TaskStop Tool](https://learn.benibix.com/term/ai/task-stop-tool)

## Told apart from

- [/exit vs /stop](https://learn.benibix.com/compare/exit-command-vs-stop-command): People often think /exit ends a background session. It only lets go of it, and the work goes on. /stop is the one that ends it, and it keeps the chat and the worktree. In a normal session, /exit closes Claude Code and saves the chat for later.

## Taught in

- [Background Session Commands](https://learn.benibix.com/learn/ai-claude-code-commands/background-session-commands): Claude Code Commands, 7/17

![Three background sessions in a list: one working, one waiting for you, one done. Your terminal can attach to any of them and leave again.](https://learn.benibix.com/diagrams/cmd-background-session.svg)

---

Source: https://learn.benibix.com/term/ai/stop-command
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
