---
url: /examples/remove-unused.md
---
# Remove what you no longer use

Remove the sessions you are done with, an agent you stopped using, and the files nothing needs anymore. The example removes the example agent `reviewer`.

## 1. See what you have

`pandra agent list` shows the agents in your [store](/share/pulling.md#managing-your-store), one row per reference:

```sh
pandra agent list
```

```text
AGENT                                          REF               DIGEST        DESCRIPTION                                                                                       READY  BLOCKERS
github.com/pandra-io/pandra/examples/reviewer  <default branch>  52c8e3b28569  Reviews the changes in your workspace for correctness and safety first, then needless complexity  yes    -
```

`pandra ps -a` lists every session, as in [continue a conversation later](/examples/continue-a-conversation.md).

## 2. Remove the sessions

`pandra session prune` removes every session that no run is using, after you confirm. A session's log goes with it. A workspace that `--workspace new` created goes with its session, whatever it holds, while a session whose `--worktree` may hold work is kept:

```sh
pandra session prune
```

```text
✓ Remove 6 sessions? 0 workspaces with content will be deleted with them. Yes
Removed session af729a2da7dd4ef78309b6b0ebe261a0 (cart-review)
Removed session 8a7f898cddb14a6c957e389ef713bf78
...
```

To remove one session, use `pandra session remove` with its ID or name.

## 3. Remove the agent

Remove the agent from your store. Your approval goes with its last reference, so a later run asks again:

```sh
pandra agent remove github.com/pandra-io/pandra/examples/reviewer
```

```text
Removed reviewer 0.1.0
  Reference:  github.com/pandra-io/pandra/examples/reviewer
  Digest:     sha256:52c8e3b2856980c2baeb2b4772ae13f1beeb79b4c9f257109468ee50563c7f6d (package deleted)

Removed the approval
  Source:  github.com/pandra-io/pandra/examples/reviewer
```

Your settings for the agent stay in your configuration.

## 4. Free the disk space

`pandra system prune` removes what nothing uses anymore, after you confirm:

```sh
pandra system prune
```

```text
This will remove:
  - stored packages and agent environments that nothing uses
  - materialized sources that no stored package refers to
  - cached downloads, Git caches, and tool versions Pandra no longer pins
  - leftovers of interrupted writes
✓ Continue? Yes
Removed 4 agent environments
Removed 21 materialized sources
Removed 6 Git caches
Reclaimed 20.1 MiB
```

It removes only what Pandra can recreate, and `--sessions` also removes sessions. It never removes installed harnesses, approvals, registry credentials, or the agents in your store. Your counts and sizes differ.

[Learn more about managing your store →](/share/pulling.md#managing-your-store)
