agentleFS
jscott3201jscott3201/yet-more-skills/skills/memory-context-hygiene/SKILL.md

memory-context-hygiene

Skill4 starsChanged 2 months agoApache-2.0View on GitHub

Design, debug, or use persistent agent memory when retrieval freshness, scope, provenance, or stale task state matters. Not every repository search, transcript storage, or automatic reindexing.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use memory to recover context, not to manufacture current authority.

    line 9
  2. Distinctive:

    Use supported update/supersession behavior rather than creating competing versions of the same task fact.

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Memory and Context Hygiene

Use memory to recover context, not to manufacture current authority. Distinguish durable decisions and user preferences from volatile task status, inferred summaries, and source-derived technical facts.

Retrieve narrowly and verify consequential claims

Resolve the intended user, project, repository, and permitted source scope. Retrieve only what helps the current question and inspect the underlying source when correctness depends on it. An index hit is a pointer, not proof that an API is still implemented or a PR is merged. An empty result with incomplete coverage is not proof of absence.

Prefer current live state for volatile status. Keep past decisions with their rationale and conditions rather than silently rewriting history. When memory and current source disagree, show the conflict and determine whether the decision, implementation, or summary is stale. Do not automatically choose the newest timestamp; it may be a newer copy of an old claim.

Write only useful, authorized memory

Follow the active application's persistence and privacy rules. Store a concise claim, its source, scope, and relevant validity condition when the write is authorized and future reuse is valuable. Do not save secrets, raw transcripts, speculative diagnoses, or unnecessary customer/device data. Honor deletion and scope restrictions, including derived summaries or indexes where the actual system requires it.

Use supported update/supersession behavior rather than creating competing versions of the same task fact. Respect optimistic concurrency or ownership controls exposed by the store. A second agent's stale summary must not overwrite a newer resolved decision simply because its write arrived last.

Keep context economical

Retrieve for the next unresolved question, with the relevant project and task scope, rather than loading a whole project archive or memory timeline. Use a supported limit and follow-up reference; broaden when missing coverage or contradictory evidence matters. Reuse an adequate result until new edits, changed scope, or stale state invalidate it.

Preserve user constraints, authority, unresolved failures, operation outcomes, and source pointers through compaction. A summary is lossy and cannot replace decisive source. Do not compress repeatedly by habit or claim that writing a summary removes tokens already in the host's context; actual masking and compaction require runtime support. Use ordinary source search when a memory service is missing; do not install, reindex, migrate, or invent memory APIs to proceed.

For memory-system changes, test tenant/project isolation, stale retrieval, duplicate writes, conflicts, interrupted persistence, deletion behavior, and recovery. Separate source-of-truth records from derived embeddings, graphs, and caches. Rebuilding a derived index must not silently resurrect deleted or superseded authority.

Return the useful context, important freshness limits, and actual writes performed—not a new memory-management ceremony.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.