---
url: https://bishop.agentdeployment.co/deploying/cleanup.md
description: >-
  How Bishop removes what old conversations leave behind, and how to run that
  yourself.
---

# Cleaning Up

A finished conversation leaves things behind: the snapshot it was pinned to, the worktree and branch it edited in, the files people shared in it, and its rows in Bishop's database. A schedule leaves a set every time it fires, which for an hourly one is 24 a day.

Bishop collects them itself, at startup and every six hours after, so a gateway left running for months doesn't fill a disk. Everything a thread left is kept for 30 days past its last turn:

```json
{
  "gc": {
    "maxAgeDays": 30
  }
}
```

A snapshot a thread is still using is kept however old the commit is, and so is `current`. Nothing a live conversation is using is ever touched.

**It deletes what it collects.** A worktree goes with its branch, including work the agent committed there and nobody merged, and a thread that comes back after that starts fresh on the current files. If a thread's work matters, merge it before it ages out, or raise `maxAgeDays`.

**A collected thread stops being one Bishop is listening to.** In a Slack channel, mention the agent to pick it up again: a reply without a mention in a thread that old is ignored. DMs and email are unaffected.

## On your own terms

With Bishop stopped, or from cron:

```sh
bishop gc
bishop gc --max-age-days 7
```

It reads the database and the disk and nothing else, so it needs no credentials. It leaves the database copies in `.bishop/backups/` alone. See [Upgrading](/deploying/upgrading).
