/exit vs /stop
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.
/exit Command
It closes Claude Code. The session is saved.
/exit closes Claude Code and takes you back to your shell, and the session is saved on disk. So /resume or claude --continue can open it again later. In a background session you are attached to, /exit only leaves it, and the session keeps running. Alias /quit.
/stop Command
It ends the background session you are in.
/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.
In one line
- /exit Command
- It closes Claude Code. The session is saved.
- /stop Command
- It ends the background session you are in.