memory-hygiene

memory-hygiene is a skill for Claude Code, Codex from fthsrbst/mnema. It costs 56 tokens per session (898 once invoked), scanned A, original, MIT.

A set of practices for keeping an agent's stored notes accurate and useful. It finds duplicates, outdated entries, and contradictions, and can archive old records without deleting them.

In plain words
What is it for?
Use it to inspect memory quality, archive stale records, identify contradictions, merge duplicate notes, and remove or correct outdated information.
Why use it?
It reduces repeated or conflicting information that could cause an agent to recall the wrong guidance.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect memory quality, archive stale records, identify contradictions, merge…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fthsrbst/mnema/memory-hygiene
Install

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.

Any agent
npx skills add fthsrbst/mnema --skill memory-hygiene
Clone the repo
git clone --depth 1 https://github.com/fthsrbst/mnema

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for memory-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/skills/fthsrbst/mnema/memory-hygiene.svg)](https://agentmods.dev/skills/fthsrbst/mnema/memory-hygiene)
Your own site
<a href="https://agentmods.dev/skills/fthsrbst/mnema/memory-hygiene"><img src="https://agentmods.dev/badge/skills/fthsrbst/mnema/memory-hygiene.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 898 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.00898
Opus 5 $0.00028 $0.00449
Sonnet 5 $0.00011 $0.00180
Haiku 4.5 $0.00006 $0.00090

Measured 6d ago against content hash 2f6bfff5d15f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

memory-hygiene 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 6d 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.

skills/memory-hygiene/SKILL.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bellek Hijyeni (Memory Hygiene)

Hub zamanla tekrar, eskimiş ve çelişkili kayıtlarla dolar. Hijyen araçları bu sorunları tespit eder ve çözer.

Hijyen Raporu

hygiene_report

{}

Dönen rapor:

  • duplicates — benzer/tekrar kayıtlar (aynı bilgi farklı wording)
  • stale — uzun süredir erişilmemiş, düşük önem kayıtlar
  • contradictionscontradicts ilişkisi olan ama ikisi de aktif kayıtlar
  • suggestions — önerilen aksiyonlar

Otomatik Temizlik

hygiene_run

{}

Yapılan işlemler:

  1. Eskileri arşivle: 90+ gün erişilmemiş, importance < 0.7 → importance 0.5'e düşür, "archived" tag ekle
  2. Çelişkileri işaretle: contradicts ilişkisi olan kayıtları raporla

Dikkat: Otomatik temizlik silmez, sadece arşivler. Silme kararı manuel verilmeli.

Manuel Müdahale

Tekrar Birleştirme

İki kayıt aynı bilgiyi içeriyorsa:

  1. İyi olanı seç (daha eksiksiz, daha güncel)
  2. memory_update ile diğerinin bilgisini ekle
  3. Kötü olanı memory_delete ile sil

Çelişki Çözümü

İki kayıt çelişiyorsa:

  1. Hangisi doğru/güncel belirle
  2. Yanlış olanı sil VEYA memory_update ile düzelt
  3. Çelişki ilişkisini kaldır

Eskimiş Temizliği

stale listesindeki kayıtlar için:

  • Hâlâ geçerli mi? → importance artır, last_accessed güncelle
  • Artık geçersiz mi? → sil
  • Nadiren lazım mı? → arşivde bırak (importance 0.5)

Bilgi Sıkıştırma (Compaction)

compact_project

{ "project": "my-project", "mode": "sessions" }

Modlar:

  • sessions — son N oturum özetini tek "proje geçmişi" dokümanına sıkıştır
  • decisions — eski kararları karar-özet dokümanına birleştir
  • distill — tam sıkıştırma: oturumlar + kararlar + eski hafızalar → özet referans

Ne zaman sıkıştır:

  • Proje çok uzun süredir aktif (50+ oturum)
  • Bağlam çok büyüdü, recall yavaşladı
  • Eski bilgiler artık detay değil, sadece özet yeterli

Periyodik Bakım Önerisi

Sıklık Aksiyon
Her oturum Çelişki görürsen hemen düzelt
Haftalık hygiene_report kontrol et
Aylık hygiene_run + manuel tekrar birleştirme
Proje bazlı 50+ oturumda compact_project

Read the full file on GitHub · 89 lines

Changes

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.

  1. 6d ago First seen · 89 lines · 56 tokens per session scan A 2f6bfff5d15f

Subscribe to this mod's changes

memory-hygiene is a skill published in the GitHub repository fthsrbst/mnema (2 stars, last pushed 7d ago), licensed MIT. It adds 56 tokens to every session and 898 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-08-31.

Related

Other skills, from other repositories

recall

Use Recall to search, inspect, continue, export, resume, or share indexed AI coding sessions. Trigger for project-history lookup, recent work from other agents, file history, unfinished-session continuation, and published session-page management.

samzong/Recall · 48 tokens

reflect

Use Recall Reflect to review AI coding workflow history as a conversation-first timeline and discuss observed patterns before changing behavior. Trigger when the user asks to reflect on a project, review AI coding workflow, inspect workflow friction, discuss repeated corrections, review handoffs, or explore possible…

samzong/Recall · 57 tokens

memorywhale

Query and write durable debugging memory recorded by MemoryWhale. Use when debugging a failure that may have happened before, when you need the exact error/flags/output from an earlier attempt, when the user asks "how did we fix this last time?", or once you've figured out why something failed / how a fix worked and…

wuisabel-gif/MemWhale · 79 tokens

daily-brief-loop

Use only when the user explicitly asks to run, sync, advance, or persist Mora's durable daily brief. Executes the once-per-day, human-checkpointed NO-SEND operator loop, performs configured source syncs, writes the dated artifact and run log, and advances the brief watermark.

pyranthus-hq/mora · 63 tokens

any-mcp

Use when an agent needs to read, search, create, edit, organize, upload, or chat with Anytype through the bounded any-mcp server. Covers safe tool selection, exact identifier chaining, optional toolsets, common PKM workflows, and the narrow anyr fallbacks for chat subscriptions and rich chat blocks.

stevelr/anytype · 68 tokens

mora-recall

Retrieve the user's own history before answering questions about their people, projects, meetings, messages, decisions, commitments, or past work. Use for requests such as "what did we discuss", "what did I decide", "what do you know about", "catch me up", and "what changed".

pyranthus-hq/mora · 65 tokens