heading-os: Skill for Claude Code

.claude/skills/memory-hygiene/SKILL.md

memory-hygiene is a skill for Claude Code from mishahanin/heading-os. It costs 160 tokens per session (1,022 once invoked), scanned A, original, Apache-2.0.

A detector for objective problems in an automatic memory system and its related Odin brain data. It reports broken references, circular links, unlinked memory files, size-limit breaches, and selected stale data.

In plain words
What is it for?
Use it to run a memory health check and produce a dated report of defects and advisories; it reports problems but does not fix or delete files.
Why use it?
It finds mechanically verifiable memory problems before they cause missing, inconsistent, or unusable context.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

This is mishahanin/heading-os's own configuration. It tells Claude Code how to work on heading-os itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything heading-os configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/memory-hygiene.py.

Reuse

Borrowing it

Nothing to install: this file belongs to mishahanin/heading-os. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mishahanin/heading-os/main/.claude/skills/memory-hygiene/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/mishahanin/heading-os

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/mishahanin/heading-os/memory-hygiene/github.svg)](https://agentmods.dev/skills/mishahanin/heading-os/memory-hygiene)
Your own site
<a href="https://agentmods.dev/skills/mishahanin/heading-os/memory-hygiene"><img src="https://agentmods.dev/badge/skills/mishahanin/heading-os/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/mishahanin/heading-os/memory-hygiene"><img src="https://agentmods.dev/badge/skills/mishahanin/heading-os/memory-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,022 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Memory Poisoning · line 42
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
  • medium Excessive Agency · line 6
    Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
    Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
How audits are shown
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.00160 $0.01022
Opus 5 $0.00080 $0.00511
Sonnet 5 $0.00032 $0.00204
Haiku 4.5 $0.00016 $0.00102

Measured 9d ago against content hash 53ed4a8aa27b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 · 86 lines

How it starts

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

Memory Hygiene

Detect objective memory defects. This skill is a detector, not a fixer: it surfaces deterministically-verifiable rot and hands resolution to /dream. It NEVER merges, deletes, or rewrites memory.

Phase 0 - Run the detector

python scripts/memory-hygiene.py

The script:

  • Reads the canonical auto-memory dir (<data-root>/auto-memory/) and computes orphans, line-budget breach, and stale files.
  • Runs odin-brain-health.py --compile and reads its temporal-validity errors.
  • Writes outputs/operations/memory-hygiene/YYYY-MM-DD_memory-hygiene_report.md.
  • Prints a one-line summary and exits 0 (clean) or 1 (objective defects present).

If the Odin brain is unavailable, the script degrades clearly and still reports the auto-memory half.

Phase 1 - Present the result

Read the report it wrote and present, grouped:

  1. Objective defects (the gate) - dangling/circular superseded_by, orphan memory files, over-budget MEMORY.md. These are the items that need action.
  2. Advisory (non-gating) - stale files (>45 days), Odin stale seeds/positions, orphan principles, near-duplicate pairs, volatile pointers, and dangling [[wikilinks]]. Mention counts; do not treat as failures.

Read the dangling-link list for breadth, not for count. One unresolved link marks a memory worth writing later, which the convention allows. A target cited by several files is different: it usually means those files share a premise that died with the pointer. Name such a target to /dream explicitly.

State the exit posture plainly: "clean" or "N objective defect(s)".

Phase 2 - Hand resolution to /dream

If objective defects exist, recommend /dream to resolve them (consolidation is judgement). Do NOT fix them here. Name the specific defects so /dream has a worklist.

NEVER

  • NEVER merge, delete, reword, or otherwise mutate any memory file - resolution is /dream, human-gated.
  • NEVER include judgement defects (semantic contradictions, near-duplicate facts, stale-but-maybe-valid positions) in the gate; those are advisory only.
  • NEVER claim the brain half ran when the script reported it unavailable - surface the degradation.

Read the full file on GitHub · 86 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 86 lines · 160 tokens per session scan A 53ed4a8aa27b

Subscribe to this mod's changes

memory-hygiene is a skill published in the GitHub repository mishahanin/heading-os (11 stars, last pushed today), licensed Apache-2.0. It adds 160 tokens to every session and 1,022 once invoked, about $0.0008 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-30.