# claude rm Command

> It takes a background session off the list.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude rm, Delete a background session

## Think of it like

It is like you take a done card off the board. You keep it in a drawer.

## Definition

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.

## Example code

```bash
claude rm 7c5dcf5d
```

Take this session off the list.

## Why it matters

A short list is easy to read. Old sessions are still there if you need them later.

## Common mistake

Thinking it deletes the chat for good. The transcript stays, and claude --resume can open it.

## Three principles

- **Off the list.** Not gone.
- **Transcript stays.** claude --resume.
- **Guards changes.** Uncommitted work.

## Related terms

- [claude respawn Command](https://learn.benibix.com/term/ai/claude-respawn-command)
- [Background Session](https://learn.benibix.com/term/ai/background-session)
- [Worktree Isolation](https://learn.benibix.com/term/ai/worktree-isolation)

## 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-rm-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.
