Data retention
The daemon deletes its own old log files so the logs directory doesn’t grow forever. Only daemon and crash logs qualify, including the numbered segments the daemon log rolls into: session logs and session data are never pruned. The limit is Retention.Logs.Days, 14 days by default. Change it when you want a longer audit trail or a smaller disk footprint.
What gets deleted
Section titled “What gets deleted”| Deleted | Never deleted |
|---|---|
daemon-yyyy-MM-dd.log, daemon-yyyy-MM-dd.N.log and crash-*.log files in ~/.netclaw/logs/ whose date is more than Retention.Logs.Days days ago | Session logs and session data, including everything in subfolders such as logs/sessions/ |
| The newest 3 daemon log files and the newest 3 crash logs, however old. Segments count as files, so three segments of one day can be the three kept | |
Any other file in logs/, such as notes.log or a compressed daemon-2026-01-09.log.gz. Only the exact names above match, so a zero-padded daemon-2026-01-09.01.log is left alone |
The daemon log rolls over when it reaches 10 MiB: the next lines go to daemon-yyyy-MM-dd.1.log, then .2.log, and so on. A new UTC date starts the series again. Retention prunes the segments by the date in their names, like the first file of the day.
The age comes from the date in the file name, in UTC. Today’s log is never old enough to qualify. The newest-three rule means a wrong system clock can’t wipe your whole history.
When it runs
Section titled “When it runs”The daemon runs the clean-up 30 seconds after it starts, then every 12 hours. A change to Retention.Logs.Days restarts the daemon like any netclaw.json change, so the new limit takes effect on that restart’s first run. Setting 0 keeps the logs forever and the clean-up deletes nothing.
Change the limit
Section titled “Change the limit”netclaw config retention # show the current valuenetclaw config retention --logs-days 30 # keep 30 daysnetclaw config retention --logs-days 0 # keep foreverThe same screen is in netclaw config under Data Retention: type the number and press Enter. To write the key yourself:
{ "Retention": { "Logs": { "Days": 30 } }}The environment variable NETCLAW_Retention__Logs__Days=30 works too and wins over netclaw.json. netclaw config retention warns when one is set. Environment changes need a manual daemon restart.
| Field | Type | Default | Allowed values |
|---|---|---|---|
Retention.Logs.Days | integer | 14 | 0 to 36500. 0 keeps logs forever. |
netclaw config rejects anything outside that range and writes nothing. In a hand-edited file, a value that isn’t an integer falls back to 14 days and the daemon logs a warning at startup. The daemon still starts. A negative number keeps everything, like 0.
Confirm it ran
Section titled “Confirm it ran”When the clean-up deletes something, the daemon log says so:
02:45:44.817 [INF] Netclaw.Daemon.Services.DataRetentionActor: Retention: deleted 7 expired daemon and crash log file(s) older than 14 days.A run that finds nothing to delete writes nothing. A file it can’t delete (a read-only volume, say) logs Retention: could not delete N expired daemon and crash log file(s); will retry at the next run. and the daemon keeps going. A bad stored value shows up as:
[WRN] Netclaw.Startup: Configuration warning: Retention:Logs:Days value 'soon' is not an integer; using the default of 14 days.Look in ~/.netclaw/logs/daemon-<date>.log, or docker exec <container> sh -c 'grep Retention ~/.netclaw/logs/daemon-*.log' in Docker.
Retention elsewhere
Section titled “Retention elsewhere”Completed one-shot reminders are removed after 12 days.
Related pages
Section titled “Related pages”netclaw config: the Data Retention screen andconfig retention- Configuration reference: every key, including
Retention.Logs.Days - Data directory layout: where logs and sessions live
- Docker: keep the home volume’s logs in check
- Back up, restore and move netclaw: what to copy before logs age out
Resources
Section titled “Resources”- .NET configuration providers: how
NETCLAW_environment variables map to JSON keys - Docker logs and volumes: where a container’s home volume lives