agentleFS
BSSE23047BSSE23047/nauraiz-dev/skills/memory-hygiene/SKILL.md

memory-hygiene

Skill2 starsChanged 14 days agoMITView on GitHub

Clean up project memory: 'clean up my memory', 'prune the knowledge files', MEMORY.md too long. Finds stale or relative-dated entries, dead file references. Not for adding a lesson (capture-lesson).

11 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Scan: Run node "${CLAUDE_PLUGIN_ROOT}/scripts/memory/scan.mjs" <dir>...

    line 25
  2. Distinctive:

    Check what the script cannot: Read the files it flagged, plus the index.

    line 30
  3. Very specific:

    If the /doctor command is available in this Claude Code version, mention it: it audits the prompt files this skill does not cover.

    line 51

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “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-hygiene

Memory rots: "yesterday" means nothing a week later, files get renamed, facts stop being true. This finds the rot and proposes fixes; the owner approves each one.

"Stop" and "ask" mean: end your turn with the question and wait.

  1. Find the folders. The project's .claude/knowledge and .claude/rules (those that exist), and the auto-memory folder: Glob */memory/MEMORY.md in <home>/.claude/projects and take the folder named like the current directory with every non-alphanumeric character replaced by -, compared case-insensitively. No match: scan without it and say so.

    local mode (the session header shows mode=local, or .claude/nauraiz-dev.local.json exists and .claude/nauraiz-dev.json does not): edits go only inside the auto-memory folder. For .claude/knowledge and .claude/rules list the proposals but never apply them: those files are tracked.

  2. Scan. Run node "${CLAUDE_PLUGIN_ROOT}/scripts/memory/scan.mjs" <dir>... with those folders (quote paths; add --today <date> only if asked). It prints JSON: per file lines, bytes, relativeDates, staleSince, missingRefs, brokenLinks, and index for MEMORY.md (overLimit above 200 lines or 25,000 bytes).
  3. Check what the script cannot. Read the files it flagged, plus the index. Look for two entries that contradict each other, a fact the code now disproves (Grep to check), and entries that duplicate each other. Do not Read files nothing flagged.
  4. Propose, do not edit. Show one diff-style list, grouped by file:
    • relativeDates: rewrite to the absolute date the entry was written (from the file's own dates or git log); if unknown, ask.
    • staleSince: confirm, update or delete. Say the date and the age.
    • missingRefs and brokenLinks: fix the path, drop the reference, or delete the entry if it was only about the missing file. A flag on an ordinary word such as Next.js is a false alarm: skip it.
    • Contradictions and duplicates: say which entry wins and why.
    • index.overLimit: name the entries to merge or drop to get under the limits. Then stop and ask which to apply.
  5. Apply only the approved ones with Edit, and in local mode only inside the auto-memory folder. Edits stay within files: you cannot rename or delete one. When a file must go or be renamed, tell the owner which, to do by hand, and keep MEMORY.md and knowledge/README.md in step. Run the scan again and report the counts before and after.
  6. If the /doctor command is available in this Claude Code version, mention it: it audits the prompt files this skill does not cover. Do not run it for the owner.

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.