Routine Cleanup is a Claude Code skill that deletes a routine’s old runs in bulk while keeping the newest ones and any run you replied in. GitHub user naw103 published it in the claude-routine-cleanup repository and shared it in a Show HN post on October 3, 2026. Everything below is what the author reports in the post and the repository’s README, unless a line links to Anthropic’s docs.
On this page
The problem the author describes
Scheduled tasks in the Claude desktop app (Anthropic’s docs) leave a session behind each time they run. In the Show HN post, naw103 writes that one routine had piled up 618 open sessions and that the desktop app only deletes them one at a time. The README adds that an hourly routine makes more than 700 sessions a month, which take disk space and slow the app when it loads them.
How the skill works, per the README
- Plan first. A bundled Python planner sorts each run into a bucket and prints the plan. It deletes nothing itself.
- Keeps what matters. The newest N runs, runs where you typed a message or a slash command (“engaged”), runs whose transcript is gone (“unverifiable”), the current conversation and any run active in the last 15 minutes are left alone by default.
- Deletes through the app. After you approve the plan, Claude removes runs with the desktop app’s own
delete_sessiontool, 25 sessions per call, each call with its own approval card. The author says deleting the files on disk did not work: the app keeps the Runs list in memory and writes records back, leaving “Session not found on disk” entries. - Runs from a normal conversation. The author reports that the app’s delete tool is turned off inside routine runs, so the cleanup has to start from an ordinary session in the Code tab.
Install and use
The README gives two ways to install. As a plugin, in the Claude Code CLI or the desktop app’s Code tab:
/plugin marketplace add naw103/claude-routine-cleanup
/plugin install routine-cleanup@routine-cleanup
Or as a plain skill:
git clone https://github.com/naw103/claude-routine-cleanup
cp -r claude-routine-cleanup/skills/routine-cleanup ~/.claude/skills/
It needs Python 3.9 or later and the Claude desktop app. Then, in an ordinary conversation:
/routine-cleanup nightly-report keep 10
The planner can also be run by hand to see what a cleanup would remove; per the README it never deletes anything:
python3 skills/routine-cleanup/cleanup_runs.py --routine ID --keep 10 --brief
The author built it on macOS. The README says the Windows and Linux app data paths follow the app’s usual layout but are untested, and ROUTINE_CLEANUP_APP_DIR overrides them. The repository is MIT-licensed and says it is not affiliated with Anthropic.
The retention setting it points to
The README also suggests raising cleanupPeriodDays so old transcripts are not removed by age. Anthropic’s docs on the .claude directory say Claude Code deletes files under ~/.claude older than cleanupPeriodDays; the default is 30 days, the minimum is 1, and setting 0 fails with a validation error. Since v2.1.248, transcripts of sessions started or last continued in Claude Desktop are kept at any age unless you set desktopSessionCleanupPeriodDays. The README’s example:
// ~/.claude/settings.json
{ "cleanupPeriodDays": 3650 }





