Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-cleanupgit clone --depth 1 https://github.com/hoangsonww/Claude-Code-Agent-MonitorWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/session-cleanup)<a href="https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/session-cleanup"><img src="https://agentmods.dev/badge/skills/hoangsonww/claude-code-agent-monitor/session-cleanup/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/session-cleanup"><img src="https://agentmods.dev/badge/skills/hoangsonww/claude-code-agent-monitor/session-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00067 | $0.00805 |
| Opus 5 | $0.00034 | $0.00402 |
| Sonnet 5 | $0.00013 | $0.00161 |
| Haiku 4.5 | $0.00007 | $0.00081 |
Grade A, and why
session-cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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_count0 / null andcost0 (started but never did anything). - Stale active —
statusactive/working but last activity older than the threshold (default 24h), i.e. never cleanly stopped. - Truncated — no
ended_atand no recent events.
3. Preview table (ALWAYS shown)
List every candidate with the reason it qualifies. State the total count and confirm that nothing has been deleted yet.
4. Explain the endpoint
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.
5. Execute only on confirmation
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.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 78 lines · 67 tokens per session scan A 061eb2f9277d
session-cleanup is a skill published in the GitHub repository hoangsonww/Claude-Code-Agent-Monitor (989 stars, last pushed 3d ago), licensed MIT. It adds 67 tokens to every session and 805 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
commit-optimization
Use when configuring settings.json to reduce fuse-commit-pro's context token usage.
ideating
Generates and explores ideas. Use when capturing fleeting thoughts, brainstorming, exploring a problem space before committing to a direction, or reviewing stored ideas to decide what to pursue.
prime
Session prime — start a fresh session by reading project state to orient yourself. Use this when you have no project context yet or the user asks to "prime the session", "read state", or start work.
delegating-to-codex
Delegates a task to OpenAI Codex running as an interactive session in a herdr pane - uses the user's ChatGPT subscription, visible in herdr, steerable mid-session. Use when delegating work to codex, offloading a task to a GPT model (sol, terra, luna), or running a second opinion from a non-Claude frontier model. Not…
handoff
Capture current work context for handoff to another agent/developer. Gathers git state, todos, and modified files into a structured handoff document saved to the related spec folder.
notion-to-blog
Transfer a blog post from Notion to the Wasp blog. Fetches content, downloads and optimizes images, and creates a properly formatted MDX file.