Memory Hygiene

Memory Hygiene is a skill for Claude Code from ralfyishere/rules-with-receipts. It costs 97 tokens per session (1,462 once invoked), scanned A, original, MIT.

Instructions for managing context during long or resumed AI-agent sessions, including separating lasting facts from temporary or outdated information.

In plain words
What is it for?
Use them after context is summarized, when sessions continue over time, or before relying on earlier facts, decisions, files, or preferences.
Why use it?
They reduce mistakes caused by relying on old assumptions or treating every remembered detail as current.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use them after context is summarized, when sessions continue over time, or before relying on earlier facts, decisions, files, or preferences.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ralfyishere/rules-with-receipts/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 ralfyishere/rules-with-receipts --skill memory-hygiene
Clone the repo
git clone --depth 1 https://github.com/ralfyishere/rules-with-receipts

Made for: Claude Code.

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/ralfyishere/rules-with-receipts/memory-hygiene/github.svg)](https://agentmods.dev/skills/ralfyishere/rules-with-receipts/memory-hygiene)
Your own site
<a href="https://agentmods.dev/skills/ralfyishere/rules-with-receipts/memory-hygiene"><img src="https://agentmods.dev/badge/skills/ralfyishere/rules-with-receipts/memory-hygiene/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.

agentmods 80×15 button for Memory Hygiene

Your own site · 80×15
<a href="https://agentmods.dev/skills/ralfyishere/rules-with-receipts/memory-hygiene"><img src="https://agentmods.dev/badge/skills/ralfyishere/rules-with-receipts/memory-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,462 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.00097 $0.01462
Opus 5 $0.00048 $0.00731
Sonnet 5 $0.00019 $0.00292
Haiku 4.5 $0.00010 $0.00146

Measured 9d ago against content hash 9448237684c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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.

.claude/skills/memory-hygiene/SKILL.md · 76 lines

How it starts

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

Memory Hygiene

Purpose

In a long session, your context is a mix of load-bearing facts, expired snapshots, superseded decisions, and things you inferred once and never checked. Treating that mix as uniformly true causes a distinctive class of error: acting confidently on information that was correct. The discipline: know which class each remembered item belongs to, and re-verify anything load-bearing that the world could have changed since you learned it.

When to use this skill

  • Long sessions, resumed sessions, and any session after context compaction/summarization — the summary preserved conclusions but dropped the evidence behind them.
  • Before acting on something you recall from "earlier": a file's contents, a decision, a constraint, a number.
  • When the user says something that contradicts your memory — the user is more current than your context.
  • When deciding what to write to persistent memory files, and when reading memories back in a later session.

When NOT to use this skill

  • Short sessions where everything relevant is a few messages up and nothing has changed it.
  • Don't ritualize: re-verifying a stable user preference every turn is friction, not hygiene. The test is could it have changed, and is it load-bearing?

Operating procedure

Step 1 — Classify before relying. When reaching for a remembered item, tag it:

Class Examples Reliability rule
Durable fact The project is in Python; the user's role; decisions explicitly confirmed Trust; re-verify only on contradiction
User preference Tone, format, "always show diffs", risk appetite Trust until contradicted; newest statement wins
Snapshot File contents you read, test results, data values, what a doc said Expires the moment anything could have changed it — incl. your own edits. Re-observe before load-bearing use (live-state-truth)
Working assumption Things inferred to proceed, never confirmed Still an assumption no matter how long ago you made it; label or verify
Superseded Plans revised mid-session, requirements the user changed Actively dangerous — the old version is still in your context, fluent and available. Latest statement wins
Task-local detail Variable names from a finished task, one-off constraints Let it go; do not generalize to new tasks

Read the full file on GitHub · 76 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. 9d ago First seen · 76 lines · 97 tokens per session scan A 9448237684c9

Subscribe to this mod's changes

Memory Hygiene is a skill published in the GitHub repository ralfyishere/rules-with-receipts (2 stars, last pushed 1mo ago), licensed MIT. It adds 97 tokens to every session and 1,462 once invoked, about $0.0005 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

distill-feedback

A process for turning corrections you give an agent into lasting working rules. It reviews saved conversations and asks for approval before changing those rules.

AnastasiyaW/codex-claude-code-config · 146 tokens

contextpilot

Optimize document ordering in LLM context for better retrieval performance.

EfficientContext/ContextPilot · 14 tokens

knowledge-base

Retrieves and updates project-specific prompt knowledge from comparison evidence and user feedback. Use only for prompt analysis or post-comparison learning within a Rashomon evaluation.

shinpr/rashomon · 34 tokens

obsidian-vault

Create, edit, and audit notes in an Obsidian vault. Handles frontmatter properties, wikilinks, embeds, callouts, tasks, block references, tags, and Mermaid diagrams. Plugin-aware: Dataview queries and inline fields, Tasks emoji syntax, Kanban boards, Meta Bind fields, Templater templates, Bases schemas, and Canvas…

aliasunder/agent-skills · 252 tokens

compress

Prompt-Studio memory compressor. Shrinks CLAUDE.md, todo lists, and preference files into Prompt-Studio's lean format to cut input tokens on every load. Preserves all technical substance, code, URLs, and structure. Compressed output overwrites the original; human-readable backup stored out-of-tree as FILE.original.md…

utk2103/Prompt-Studio · 98 tokens

context-economy

Automatically prepare fidelity-first, bounded context when users paste text, attach files or folders, provide webpages or PDFs for Markdown conversion, continue long conversations, or supply documents containing images and complex tables. Route each input through Text, Hybrid, or Source; reduce exact or…

TIKAZI/TIKAZ-AI-Skills · 84 tokens