Skip to content
BENIBIX Learn

claude respawn vs claude rm

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.

AI⌨️ Claude Code

claude respawn Command

It restarts a background session and keeps its chat.

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.
Why it matters
You get a fresh process or a new version, and lose none of the work so far.
Full entry
AI⌨️ Claude Code

claude rm Command

It takes a background session off the list.

claude rm takes a background session off the list in agent view, once you are done with it. Its chat stays on your computer, so you can still open it with claude --resume. It will not delete a session whose worktree has changes you have not saved to git, so you do not lose work by mistake.

Example
Jack's list has twenty finished sessions. He runs claude rm on the ones he no longer needs, and the list is short again.
Why it matters
A short list is easy to read. Old sessions are still there if you need them later.
Full entry

In one line

claude respawn Command
It restarts a background session and keeps its chat.
claude rm Command
It takes a background session off the list.