DevToolsAIProductivityCLI

SessionSweep — Scheduled Agent Session Cleanup

Automatically clean up leftover sessions from AI coding agents like Claude Code to keep your workspace tidy.

Problem
When using scheduled routines in Claude Code, each run leaves behind a session, and the desktop app only allows deleting them one at a time. This quickly accumulates hundreds of useless sessions — e.g., a single routine had 618 open sessions — making manual cleanup extremely time-consuming.
Solution
A lightweight CLI tool or editor plugin that scans agent session directories, identifies sessions created by scheduled tasks, and batch-deletes them according to rules (e.g., keep newest N, protect sessions you replied to). It works via command line or simple config, eliminating the need for manual GUI clicks.
Users
Developers who heavily use AI coding agents with session history features, such as Claude Code or Cursor, especially those running many scheduled routines.
MVP
Scan session files in a specified directory; identify session source (manual/scheduled) and timestamps from metadata; provide retention policy config (e.g., keep latest 10); batch-delete selected sessions; output cleanup report.
Revenue
Open-source core with advanced features subscription (e.g., cross-device policy sync, team sharing rules, automated periodic cleanup). Or a one-time purchase GUI version.
Why now
AI coding agents are rapidly being adopted, and their session management is still immature. An indie developer can quickly fill this gap without relying on large models — it's purely local file operations.

Source discussions · 1

  1. Hacker NewsShow HN: Claude Code Routine Session Cleanup Skill3↑ 3
← Back to list