---
title: "history in config.yaml"
url: https://devlanes.run/docs/reference/config/user/history/
description: "Reference for the history key in ~/.devlanes/config.yaml."
---

# history in config.yaml

A top-level key of [`~/.devlanes/config.yaml`](/docs/reference/config/user/).

## `history`

Type: mapping.

How long the database keeps records of finished service and task runs, and of remote boxes that no longer connect.

```yaml devlanes-user
history:
  remote_hosts_retention: 90d
  retention: 7d
```

### `history.remote_hosts_retention`

Type: [duration](/docs/reference/config/#durations). Default: `90d`.

How long a remote box stays listed by `devlanes remote ls` after its last successful connection; defaults to `90d` and must be longer than `0s`. A record without a connection time is never deleted by age, and `state.max_size` can delete records sooner. A box connected with `devlanes remote connect` and not disconnected since is never deleted, so the daemon can connect it again after a restart.

```yaml devlanes-user
history:
  remote_hosts_retention: 90d
```

### `history.retention`

Type: [duration](/docs/reference/config/#durations). Default: `7d`.

How long records of finished service and task runs (start and end times, exit status) are kept after the run ends; defaults to `7d` and must be longer than `0s`. A run that still has log index entries or a metrics summary in the database stays until those expire, and `state.max_size` can delete runs sooner.

```yaml devlanes-user
history:
  retention: 7d
```
