> 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 https://github.com/hoangsonww/Claude-Code-Agent-Monitor --skill session-cleanup
Find prune-worthy sessions and explain cleanup — preview first, delete only on
explicit confirmation.
The user provides: $ARGUMENTS
preview → only show what would be removed (the safe default).confirm → the user has reviewed the preview and explicitly authorizes deletion.older than 7d) for what counts as stale.| 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 |
GET /api/stats — record total_sessions, sessions_by_status, total_events. This is
the before-state to compare against.
GET /api/sessions?limit=1000. Flag sessions that are:
turn_count 0 / null and cost 0 (started but neverdid anything).
status active/working but last activity older than thethreshold (default 24h), i.e. never cleanly stopped.
ended_at and no recent events.List every candidate with the reason it qualifies. State the total count and confirm
that nothing has been deleted yet.
Describe POST /api/settings/cleanup: it prunes empty / orphaned sessions and their
dangling events server-side and returns a summary of removed rows. Make clear this
is permanent and not reversible from the dashboard.
If — and only if — $ARGUMENTS is confirm (or the user has explicitly approved
this run), call POST /api/settings/cleanup, then re-read /api/stats and report
the before → after delta. Otherwise stop after the preview and tell the user to
re-run with confirm.
A preview Markdown table: id (short) | status | reason | cwd basename | started_at | cost,
then a one-line count and the explicit "nothing deleted — re-run with confirm to
proceed" notice. On a confirmed run, add a before → after summary using ▲/▼ on the
counts. Currency as USD to 4 decimal places.
documented endpoint.
POST /api/settings/cleanup without an explicit confirm from theuser in this turn — previewing is the default.
POST /api/settings/clear-data or any other destructiveendpoint; cleanup of stale/empty sessions only.
npm start fromthe repo root.
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Replace with description of the skill and when Claude should use it.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Take hoangsonww/session-cleanup from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.