session-cleanup
Identify stale and empty Claude Code sessions in the Agent Monitor and explain the cleanup endpoint (POST /api/settings/cleanup), always showing the exact list of what WOULD be removed before anything is deleted. Cleanup permanently deletes data, so this skill previews first and requires explicit user confirmation. Use when tidying the monitoring database.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-cleanup --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Session Cleanup Find prune-worthy sessions and explain cleanup — preview first, delete only on explicit confirmation. ## Input The user provides: **$ARGUMENTS** - Empty / `preview` → only show what would be removed (the safe default). - `confirm` → the user has reviewed the preview and explicitly authorizes deletion. - An optional staleness threshold (e.g. `older than 7d`) for what counts as stale. ## Data Sources | Endpoint | Returns | |----------|---------| | `GET /api/sessions?limit=N` | session list: id, status, model, cwd, started_at, ended_at, cost, metadata (turn_count, total_turn_duration_ms) | | `GET /api/stats` | totals: total_sessions, active_sessions, total_events, events_today, sessions_by_status, agents_by_status | | `POST /api/settings/cleanup` | runs the cleanup routine and returns what was removed — DESTRUCTIVE, only after confirmation | ## Report Sections ### 1. Baseline `GET /api/stats` — record total_sessions, sessions_by_status, total_events. This is the before-state to compare against. ### 2. Identify candidates `GET /api/sessions?limit=1000`. Flag sessions that are: - **Empty** — zero events and `turn_count` 0 / null and `cost` 0 (started but never did anyt
- Input
- Data Sources
- Report Sections
- 1. Baseline
- 2. Identify candidates
- 3. Preview table (ALWAYS shown)
- 4. Explain the endpoint
- 5. Execute only on confirmation
- Output
- Safety
What does the session-cleanup skill do?
Identify stale and empty Claude Code sessions in the Agent Monitor and explain the cleanup endpoint (POST /api/settings/cleanup), always showing the exact list of what WOULD be removed before anything is deleted. Cleanup permanently deletes data, so this skill previews first and requires explicit user confirmation. Use when tidying the monitoring database.
How do I install it?
Run `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-cleanup --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From hoangsonww/Claude-Code-Agent-Monitor, a repository with 869 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
