# How the Archon Cleanup Service Manages Old Workflow Runs and Associated Worktrees

> Learn how the Archon cleanup service automatically manages old workflow runs and worktrees, reclaiming disk space while preserving active sessions. Manual purge commands are also available.

- Repository: [Cole Medin/Archon](https://github.com/coleam00/Archon)
- Tags: how-to-guide
- Published: 2026-04-10

---

**The Archon cleanup service automatically reclaims disk space by removing merged and stale git worktrees every 6 hours while preserving active sessions, and provides manual CLI commands to purge old workflow run records from the database.**

The Archon project (coleam00/Archon) maintains isolated development environments using git worktrees to sandbox AI-driven workflows. As these isolation environments proliferate across codebases, the **cleanup service** implemented in [`packages/core/src/services/cleanup-service.ts`](https://github.com/coleam00/Archon/blob/main/packages/core/src/services/cleanup-service.ts) provides a robust retention strategy that aggressively targets disk space consumption while implementing strict safety checks