
Mem Clean
- 16 installs
- Updated August 4, 2026
- akunzai/agent-skills
mem-clean is a skill that interactively deletes expired short-term memory logs and resolves cloud conflict copies under a confirmed dry-run retention plan.
About
This skill interactively cleans short-term agent memory. It deletes expired daily logs computed from the YYYY-MM-DD filename under a confirmed retention window and resolves cloud-drive conflict copies. It is destructive, so it always produces a dry-run plan and requires explicit confirmation, and it blocks cleanup of logs that still hold unresolved Candidate entries.
- Deletes expired project and global daily memory logs under a confirmed retention plan
- Resolves cloud-drive conflict copies in ~/.agents/
- Destructive by design: always dry-runs and requires explicit confirmation
Mem Clean by the numbers
- 16 all-time installs (skills.sh)
- Ranked #2,100 of 3,282 Productivity & Planning skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
mem-clean capabilities & compatibility
- Capabilities
- memory
- Use cases
- memory
What mem-clean says it does
Removes expired daily logs and tidies cloud-sync conflict copies.
Default retention is 30 days, computed from the `YYYY-MM-DD.md` filename, never mtime.
npx skills add https://github.com/akunzai/agent-skills --skill mem-cleanAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 16 |
|---|---|
| Last updated | August 4, 2026 |
| Repository | akunzai/agent-skills ↗ |
What it does
Interactively delete expired daily memory logs and resolve cloud conflict copies under a confirmed, dry-run retention plan.
Who is it for?
Safely pruning expired daily memory logs and tidying cloud-sync conflict copies with explicit confirmation.
Skip if: Durable promotion or rewriting long-term memory; it only handles destructive short-term cleanup.
When should I use this skill?
You need to remove expired .memories daily logs or resolve conflicted sync copies.
What you get
Expired logs deleted per a confirmed retention plan and conflict copies resolved, with Candidate-bearing logs protected.
- Dry-run cleanup plan
- Deleted expired logs on confirmation
- Resolved cloud conflict copies
By the numbers
- Default 30-day retention
- Retention computed from filename not mtime
Files
mem-clean — Short-Term Memory Cleanup
Removes expired daily logs and tidies cloud-sync conflict copies. Every action is interactive: produce a dry-run plan and get explicit confirmation before deleting.
What it cleans
- Expired project logs in
<repo>/.memories/YYYY-MM-DD.md— see
references/short-term-cleanup.md.
- Expired global logs in
~/.agents/memories/YYYY-MM-DD.md— deleted directly
(not git-synced; see the reference).
- Cloud conflict copies (
*Conflict*/*conflicted*) in~/.agents/— see
references/cloud-conflict-resolver.md.
Rules (summary)
- Default retention is 30 days, computed from the
YYYY-MM-DD.mdfilename, never mtime. - Block cleanup of daily logs with unresolved
[Candidate]entries (not[Promoted],
[Rejected], or [Expired]).
- Leave
.memories/handoffs/files alone: active handoffs are managed bymem-auto, which
deletes each task's file on completion. Only offer to remove a handoff file when the user confirms its task is abandoned.
- Project cleanup is per-user: after deleting expired logs locally, run
/mem-sync first, then mem-sync-git.sh compact to rewrite the user's memories/<email-localpart> branch to a single commit and force-push. Other devices adopt it on next pull.
- Always show the dry-run plan (scope, retention window, delete list, blocked files,
user keep-list) and require explicit confirmation.
Cloud Sync Conflict Resolution
This reference defines how to detect, analyze, and safely resolve cloud synchronization conflicts inside memory directories.
1. Conflict File Patterns
Cloud sync engines (e.g., Google Drive, iCloud, Syncthing) create duplicate conflict copies when files are edited concurrently:
AGENTS (Conflict).md/CLAUDE (Conflict).mdAGENTS (John's conflicted copy).mdmemories/2026-06-02 (conflicted copy).md(under global~/.agents/)
2. Interactive Resolution Workflow
1. Scan: Look for filenames matching *Conflict* or *conflicted* inside the ~/.agents/ directory. 2. Extract Diff: Use diff -u or similar line-by-line comparison tools to identify unique entries in both files. 3. Draft Merge Plan: Consolidate the entries. Ensure that the latest, correct guidelines are preserved while keeping redundant entries discarded. 4. Confirm: Present the merged result and the deletion list to the user:
"I found a sync conflict in AGENTS.md. I've drafted a merged file combining the unique entries. Would you like me to commit the merge and clean up the conflict copy?" (or CLAUDE.md)5. Clean up: Delete the conflict copy only after the user approves and the merged data has been safely written to the primary file.
Short-Term Memory Cleanup Specifications
This reference defines how to clean short-term daily memory logs safely. It applies to project logs in .memories/YYYY-MM-DD.md and global logs in ~/.agents/memories/YYYY-MM-DD.md.
1. Default Retention
- Default retention is 30 days.
- A log is expired when its filename date is older than the retention window.
- Never infer retention from file modification time; use the
YYYY-MM-DD.mdfilename. - Treat malformed filenames as out of scope for automatic deletion. Report them to the user instead.
2. Confirmation Requirement
Short-term cleanup is destructive and must be interactive:
1. Scan the target scope and compute the cleanup plan. 2. Show the user:
- The target scope: project or global.
- The retention window.
- The exact files that would be deleted.
- Any files blocked from cleanup.
- Any user-specified keep list.
3. Ask for explicit confirmation before execution. 4. Do not clean anything if the user does not confirm.
If the user asks to retain specific memory entries or files, preserve those items even when they are older than the retention window.
3. Eligibility Checks
Before deleting or compacting a daily log:
- Block cleanup for daily logs containing unresolved
[Candidate]entries that are not marked[Promoted],[Rejected], or[Expired]. - Do not clean
.memories/handoffs/files here: active handoffs are owned bymem-auto, which deletes each task's file on completion. Only remove a handoff file when the user confirms its task is abandoned. - Prefer marking old candidates as
[Expired]with user confirmation before cleanup. - Redact sensitive content immediately if discovered; do not wait for the normal retention window.
Candidate Resolution Markers
A [Candidate] blocks cleanup of its file until it is resolved to one of:
[Promoted]— written by the promotion flow when the user approves promotion.[Rejected]— written when the user declines to promote a candidate.[Expired]— written here, with user confirmation, for stale candidates that were
never promoted or rejected, so cleanup is not blocked indefinitely.
Prefer marking stale candidates [Expired] (with confirmation) before deleting their log.
4. Project Scope Cleanup
Project short-term memory lives in <repo>/.memories/ and syncs through the isolated per-user branch memories/<email-localpart> (see the mem-sync skill).
After user confirmation:
1. Run /mem-sync (mem-sync-git.sh pull) first so the user's branch has collected logs from all of this user's devices. 2. Delete expired eligible logs from local .memories/. 3. Run mem-sync-git.sh compact to rebuild the user's memories/<email-localpart> branch as a single commit containing only retained .memories/ files and force-push it. 4. Other devices adopt the rewrite automatically on their next mem-sync-git.sh pull (the syncer detects the rewritten remote and reset --hards to it).
This rewrite is authoritative and per-user: it never affects other developers' branches. Do not commit .memories/ to the active development branch.
5. Global Scope Cleanup
Global short-term memory lives in ~/.agents/memories/.
After user confirmation:
1. Delete expired eligible ~/.agents/memories/YYYY-MM-DD.md files directly. 2. Preserve any files or entries the user explicitly asked to keep. 3. Report deleted files and retained exceptions.
Global cleanup does not use any git branch; it deletes files directly.
6. Dry Run Output
Before asking for confirmation, present a dry-run summary in this shape:
Short-term cleanup plan
Scope: project
Retention: 30 days
Delete:
- .memories/2026-04-20.md
Keep:
- .memories/2026-05-28.md (inside retention)
Blocked:
- .memories/2026-04-18.md (open handoff)
- .memories/2026-04-19.md (unresolved candidate)
Requires confirmation: yesExecution may proceed only after the user confirms this plan.
Related skills
FAQ
What is the default retention?
30 days, computed from the YYYY-MM-DD.md filename rather than file mtime.
Can it delete logs with pending Candidates?
No. It blocks cleanup of daily logs that hold unresolved Candidate entries.