Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

session-cleanup

БесплатноБез исполняемых скриптовНе проверен

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

tao12345666333от tao12345666333★ 56 звёзд на GitHub

Об этом скилле

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/ankaloop/sessions/ that haven't been modified in 30+ days to YYYY-MM-DD_<original_name>.json.bak
  2. Active sessions keep: Keep the most recent 10 session files (by modification time) as active
  3. Memory compaction: Compact ~/.config/ankaloop/memory/HISTORY.md to keep only the last 50 entries

Procedure

Step 1: Backup Old Sessions

  1. List all .json files in ~/.config/ankaloop/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_<original_name>.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/ankaloop/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

Установить session-cleanup в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл session-cleanup?

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

Как установить скилл session-cleanup?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл session-cleanup запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить session-cleanup с