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 tao12345666333/ankaloop --skill session-cleanupgit clone --depth 1 https://github.com/tao12345666333/ankaloopWrote 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/tao12345666333/ankaloop/session-cleanup)<a href="https://agentmods.dev/skills/tao12345666333/ankaloop/session-cleanup"><img src="https://agentmods.dev/badge/skills/tao12345666333/ankaloop/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/tao12345666333/ankaloop/session-cleanup"><img src="https://agentmods.dev/badge/skills/tao12345666333/ankaloop/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.00025 | $0.00598 |
| Opus 5.5 | $0.00010 | $0.00239 |
| Sonnet 5.5 | $0.00005 | $0.00120 |
| Haiku 4.5 | $0.00003 | $0.00060 |
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 1mo 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.
What it actually says
Session Cleanup
Backup old AnkaLoop sessions by renaming with execution date, then clean and compact sessions and memory to keep the system efficient.
What to Clean
- Session files backup: Rename session JSON files in
~/.config/ankaloop/sessions/that haven't been modified in 30+ days toYYYY-MM-DD_<original_name>.json.bak - Active sessions keep: Keep the most recent 10 session files (by modification time) as active
- Memory compaction: Compact
~/.config/ankaloop/memory/HISTORY.mdto keep only the last 50 entries
Procedure
Step 1: Backup Old Sessions
- List all
.jsonfiles in~/.config/ankaloop/sessions/directory - Get modification time of each file
- Sort by modification time (oldest first)
- Keep the 10 most recent files as active
- For files older than 30 days (or beyond the 10 most recent):
- Rename to
YYYY-MM-DD_<original_name>.json.bakwhere YYYY-MM-DD is the current execution date - Move to a
backups/subdirectory within sessions folder
- Rename to
Step 2: Clean Backup Files
- Remove
.bakbackup files older than 90 days to free space - Report: "Backed up N session files, cleaned M old backups, freed X MB"
Step 3: Compact Memory
- Read
~/.config/ankaloop/memory/HISTORY.md - Count the number of entries (each
-bullet is an entry) - If more than 50 entries, keep only the last 50 entries
- Add a summary entry at the top: "Compacted from X entries to 50 entries on YYYY-MM-DD"
Safety
- Never delete the currently active session (most recent)
- Only delete
.jsonand.bakfiles (not directories or other file types) - Always create backups before any cleanup operation
- Log each operation for audit trail
Example Output
Session Cleanup Report (2026-02-16):
- Active sessions kept: 10
- Sessions backed up: 15
- Old backups removed: 3
- Space freed: 45 MB
- Memory entries: compacted from 120 to 50
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.
- 1mo ago First seen · 62 lines · 25 tokens per session scan A 28e740d6ec16
session-cleanup is a skill published in the GitHub repository tao12345666333/ankaloop (55 stars, last pushed 2d ago), licensed Apache-2.0. It adds 25 tokens to every session and 598 once invoked, about $0.0001 per session on Opus 5.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-08-30.
Other skills, from other repositories
immune
Hybrid adaptive memory: Cheatsheet (positive patterns pre-generation) and Immune (negative patterns post-generation) with Hot/Cold tiered auto-learning. Triggers on: "scan for errors", "immune scan", "check output quality", "antibody scan". NOT for PR review (use pr-review) or repo audits (use repo-sentinel).
usage-audit
Audit a Claude Code setup for token waste and context bloat. Checks MCP servers, CLAUDE.md, skills, and settings against bloat filters. Triggers on: "audit my context", "usage audit", "token audit", "context bloat". NOT for codebase audits.
context-continuity-handoff
Preserves useful state across long agent sessions, context compaction, handoffs, and restarts. Use when compressing context, handing work between agents, resuming after interruption, writing session summaries, or preventing repeated work.
mental-model
Maintains a living mental model of the codebase. Read mental-model.md before making changes, update it when discovering new patterns or behaviors.
comet-memory
A review step for deciding whether information should become durable personal memory. It can keep, update, forget, or skip memory candidates based on bounded evidence.
git-ai-search
Search and restore AI conversation context from git history.