# claude respawn Command

> It restarts a background session and keeps its chat.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude respawn, claude respawn --all, Restart a background session

## Think of it like

It is like you wake a friend who fell asleep. They go on from the same page.

## Definition

claude respawn starts a background session again and keeps its chat. It works on one that is running or one that has stopped. Use it when a session stops, or stops answering. Add --all to start each running session again at once, so they all get a new version of Claude Code.

## Example

Lucy updates Claude Code while four sessions run. She runs claude respawn --all, and each one carries on with the same chat on the new version.

## Example code

```bash
claude respawn --all
```

Restart each one on the new version.

## Why it matters

You get a fresh process or a new version, and lose none of the work so far.

## Common mistake

Using claude rm and starting over when a session is stuck. respawn keeps the chat. rm takes the session off the list.

## Three principles

- **Restarts one.** Or --all.
- **Chat kept.** Same session.
- **New version.** After an update.

## Related terms

- [claude attach Command](https://learn.benibix.com/term/ai/claude-attach-command)
- [claude rm Command](https://learn.benibix.com/term/ai/claude-rm-command)
- [/restart Command](https://learn.benibix.com/term/ai/restart-command)

## Told apart from

- [claude respawn vs claude rm](https://learn.benibix.com/compare/claude-respawn-command-vs-claude-rm-command): People think claude rm is how you clear out a stuck background session and start again. Most of the time they want claude respawn. respawn restarts the session's process and keeps the chat, so the work goes on from where it was. rm takes the session off the list. Its transcript stays on disk, but the session is no longer running. Use respawn to fix a session. Use rm when you are done with it.

## Taught in

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

![A supervisor process runs the background sessions. claude attach, logs, respawn and rm act on one session. claude daemon acts on the supervisor.](https://learn.benibix.com/diagrams/cli-daemon.svg)

---

Source: https://learn.benibix.com/term/ai/claude-respawn-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-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
