AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Session Cleanup

skill-tao12345666333-ankaloop-session-cleanup · by tao12345666333

Backup old AnkaLoop sessions by renaming with execution date, then clean and compact sessions and memory.

No reviews yet
0 installs
20 views
0.0% view→install

Install

$ agentstack add skill-tao12345666333-ankaloop-session-cleanup

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-tao12345666333-ankaloop-session-cleanup)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Session Cleanup? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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

  1. Session files backup: Rename session JSON files in ~/.config/amcp/sessions/ that haven't been modified in 30+ days to YYYY-MM-DD_.json.bak
  2. Active sessions keep: Keep the most recent 10 session files (by modification time) as active
  3. Memory compaction: Compact ~/.config/amcp/memory/HISTORY.md to keep only the last 50 entries

Procedure

Step 1: Backup Old Sessions

  1. List all .json files in ~/.config/amcp/sessions/ directory
  2. Get modification time of each file
  3. Sort by modification time (oldest first)
  4. Keep the 10 most recent files as active
  5. For files older than 30 days (or beyond the 10 most recent):
  • Rename to YYYY-MM-DD_.json.bak where YYYY-MM-DD is the current execution date
  • Move to a backups/ subdirectory within sessions folder

Step 2: Clean Backup Files

  1. Remove .bak backup files older than 90 days to free space
  2. Report: "Backed up N session files, cleaned M old backups, freed X MB"

Step 3: Compact Memory

  1. Read ~/.config/amcp/memory/HISTORY.md
  2. Count the number of entries (each - bullet is an entry)
  3. If more than 50 entries, keep only the last 50 entries
  4. 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 .json and .bak files (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

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.