Agent skill

Memory Hygiene

by huytieu in huytieu/COG-second-brain

Periodic trust sweep of persistent memory and durable knowledge notes - re-verifies environment-dependent claims against the live environment, stamps lastverified + confidence, and proposes…

MITAuto-check passedAgent Workflows

Install Memory Hygiene

skills CLI
$ npx skills add huytieu/COG-second-brain --skill memory-hygiene -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install huytieu/COG-second-brain memory-hygiene --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/huytieu/COG-second-brain.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/memory-hygiene .claude/skills/memory-hygiene && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
memory-hygiene
GitHub stars
1.3k
Token cost
~1.2k tokens
SKILL.md length
616 words
Files
1
Skills in repo
37
Repo updated
First seen
Licence
MIT

At a glance

Periodic trust sweep of persistent memory and durable knowledge notes - re-verifies environment-dependent claims against the live environment, stamps lastverified + confidence, and proposes…

  • Works in 2 steps: Agent memory — wherever your agent keeps… → Durable knowledge notes —…
  • Tasks that involve Agent memory
  • SKILL.md covers Purpose, When to Invoke, Scope and Claim Classification, plus 5 more sections
  • Calls curl, gh and git

What it does

Memory Hygiene is an agent skill from huytieu/COG-second-brain. Periodic trust sweep of persistent memory and durable knowledge notes - re-verifies environment-dependent claims against the live environment, stamps lastverified + confidence, and proposes archiving drifted entries

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Agent memory. The repository describes itself as: Self-evolving second brain with 35 AI skills, 10 agents, and people CRM. Closed-loop harness: a V-model verification lifecycle where the worker never grades its own homework… The licence is MIT.

When your agent uses it

  • Tasks that involve Agent memory

Example prompts

  • “/memory-hygiene”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Agent memory — wherever your agent keeps persistent memory files (e.g. Claude Code's auto-memory directory). Sweep every entry except the…
  2. Durable knowledge notes — 05-knowledge/** files whose claims reference the environment (paths, URLs, IDs, tool names).

What it can do on your machine

Read from SKILL.md and the folder at commit 36ac9d7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • gh
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, gh and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Memory Hygiene loads about 1.2k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 616 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from huytieu/COG-second-brain at commit 36ac9d7, republished under its MIT licence (© huytieu). 616 words, ~1,212 tokens.

Download SKILL.mdSave it as .claude/skills/memory-hygiene/SKILL.md (or your agent's skills folder).
name
memory-hygiene
description
Periodic trust sweep of persistent memory and durable knowledge notes - re-verifies environment-dependent claims against the live environment, stamps last_verified + confidence, and proposes archiving drifted entries
roles
all

COG Memory Hygiene Skill

Purpose

Prevent the stale-but-confident failure mode: a memory or knowledge note that was correct when written ("the webhook lives at X", "the board ID is Y") silently drifts after the environment changes, yet still ranks high at recall and gets acted on.

The system move (adapted from "From Model Scaling to System Scaling: Scaling the Harness in Agentic AI", Gu, UC Berkeley, arXiv:2605.26112): make trust a runtime decision, not a property of the stored item. Re-verify against the live environment, and keep per-entry last_verified and confidence as first-class fields so future recalls can weigh trust.

When to Invoke

  • /memory-hygiene
  • "Audit my memories" / "check for stale memories"
  • After a memory misfires (a recalled fact turned out wrong)
  • Default cadence: monthly

Scope

Sweep two stores:

  1. Agent memory — wherever your agent keeps persistent memory files (e.g. Claude Code's auto-memory directory). Sweep every entry except the index itself.
  2. Durable knowledge notes — 05-knowledge/** files whose claims reference the environment (paths, URLs, IDs, tool names).

A partial sweep ("just the reference entries") is fine when asked.

Claim Classification

For each entry, split its claims into two buckets:

BucketExamplesAction
Environment-dependentfile/dir paths, repo names, branch names, channel IDs, board IDs, URLs, API endpoints, cron/routine IDs, CLI names, version numbers, "X lives at Y"Verify against the live environment
Preference / judgmenttone rules, formatting rules, "never do X", people facts, strategy contextNo environment check possible; verify only for internal contradiction with newer entries

Verification Moves (cheap first)

  • Paths and files: ls / test -e. Skills, commands, and agents named in an entry must still exist at the stated path.
  • URLs: resolve with a HEAD/GET (curl -sI); flag 404 or redirect-to-login.
  • Repos/branches: gh repo view, git ls-remote when cheap.
  • IDs (channels, boards, routine triggers): verify only if an MCP/CLI check is one call; otherwise mark unverifiable-cheaply and leave confidence untouched.
  • Cross-entry contradiction: newer entry wins; flag the older one.

Never spend more than ~1 minute per entry. This is hygiene, not an investigation. Unverifiable ≠ drifted.

Show full SKILL.md (282 more words)Show less

Stamping

After checking an entry, update its frontmatter metadata: block in place (do not touch body text unless fixing a verified-wrong fact):

yaml
metadata:
  type: reference
  last_verified: 2026-07-10
  confidence: high   # high = verified now | medium = unverifiable cheaply | low = partially drifted
  • Verified clean → confidence: high, stamp date.
  • Unverifiable cheaply → keep prior confidence (or medium), stamp date.
  • Partially drifted → fix the drifted fact directly in the body (reviewable via the report); set confidence: low only if unsure the fix is complete.
  • Fully obsolete → propose archive, don't delete. List it in the report's "Propose archive" section; only archive after the user confirms.

The Loop (see /loop-engineering)

Scan-until-done over the entry list with a per-entry budget guard (~1 min). The deterministic verifier is the environment itself (test -e, curl, gh) — never the agent's own recollection of whether something "should" still exist. Human escalation: all deletions/archives.

Report (single file)

Write one report per sweep to 01-daily/YYYY-MM-DD-memory-hygiene.md, structured around four evolution questions:

  1. What persists? — counts by type (user/feedback/project/reference).
  2. What updated? — entries whose body was corrected, with old → new.
  3. What is measured? — scorecard: verified / unverifiable / drifted / propose-archive counts, plus deltas vs the previous sweep report (the drift trend is the longitudinal signal one-shot checks miss).
  4. What is auditable? — every change in this sweep is a line in this report; for stores Git does not track, the report IS the audit trail.

End the report with a Propose archive section (explicit list, one line of evidence each) and a Waiting on you line if anything needs a decision.

Rules

  • Propose-only for deletions/archives; direct-apply for stamps and verified factual corrections.
  • Never rewrite an entry's voice or restructure it during a sweep.
  • If the memory index points at renamed/missing files, fix the index.
  • Keep the sweep itself out of memory: the report file is the record.

© huytieu, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/memory-hygiene of huytieu/COG-second-brain.

Open the folder on GitHubat commit 36ac9d7

Compare with similar skills

Memory Hygiene next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Memory Hygiene compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Memory Hygiene this skillhuytieu/COG-second-brain1.3k—~1.2kAutomated safety check: PassMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
Beads Task Memorygastownhall/beads28k—~1.2kAutomated safety check: PassMIT
Reflect on Session Learningscursor/plugins10k5 repos~1.2kAutomated safety check: PassNone
MemPalace Memory SearchMemPalace/mempalace59k—~1.4kAutomated safety check: PassMIT
Compound Learning WriterEveryInc/compound-engineering-plugin25k—~2kAutomated safety check: PassMIT

Similar skills

  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Official

    Starts three parallel reviewer subagents over the current conversation transcript, then turns their findings into concrete edits to existing skills.

    10k GitHub starsUsed in 5 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • MemPalace Memory Search

    MemPalace/mempalace

    Mines project files and conversation exports into a local, searchable memory palace and recalls past work by semantic search through the mempalace CLI.

    59k GitHub stars~1.4k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Compound Learning Writer

    EveryInc/compound-engineering-plugin

    Records one solved and verified problem as a durable learning in the repository, but only when the reasoning is not already clear from the final code, tests or docs.

    25k GitHub stars~2k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from huytieu/COG-second-brain

All 37 skills in this repo
  • Voice Baseline

    huytieu/COG-second-brain

    Measure your own writing corpus for the words and sentence shapes you over-use, so an agent writing in your voice stops amplifying your tics into a style.

    1.3k GitHub stars~957 tokensUpdated 7 days ago
    Auto-check passed
  • Daily Journal

    huytieu/COG-second-brain

    A passive daily work journal that Claude keeps FOR you so you never have to write it yourself.

    1.3k GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check passed
  • Editorial Illustrations

    huytieu/COG-second-brain

    Generate meaning-carrying editorial data-illustrations in the monotykamary / Linear aesthetic (near-black grayscale, Inter display + mono labels, hairline framed figures) with a single coral accent.

    1.3k GitHub stars~2.4k tokensUpdated 7 days ago
    Auto-check passed
  • Loop Engineering

    huytieu/COG-second-brain

    Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns.

    1.3k GitHub stars~1.5k tokensUpdated 7 days ago
    Auto-check passed
  • Release Video

    huytieu/COG-second-brain

    Turn a product release (the list of shipped items plus real screen recordings) into a motion recap video and one explained demo per feature, with sound effects tied to on-screen motion and a…

    1.3k GitHub stars~1.7k tokensUpdated 7 days ago
    Auto-check passed
  • Onboarding

    huytieu/COG-second-brain

    Personalize COG for your workflow - creates profile, interests, and watchlist files with guided setup (run this first!)

    1.3k GitHub starsUsed in 1 repo~3.1k tokens
    Auto-check passed

Categories

Questions about Memory Hygiene

What does Memory Hygiene do?

Periodic trust sweep of persistent memory and durable knowledge notes - re-verifies environment-dependent claims against the live environment, stamps lastverified + confidence, and proposes…. Memory Hygiene is an agent skill from huytieu/COG-second-brain.

When should I use Memory Hygiene?

Memory Hygiene fits situations like: tasks that involve Agent memory.

How do I install Memory Hygiene in Claude Code?

Run `npx skills add huytieu/COG-second-brain --skill memory-hygiene -a claude-code`. Or copy the skill folder (skills/memory-hygiene in huytieu/COG-second-brain) into .claude/skills/memory-hygiene in your project. Claude Code loads it when a task matches its description.

How do I install Memory Hygiene in Codex?

Run `npx skills add huytieu/COG-second-brain --skill memory-hygiene -a codex`. Or copy the skill folder (skills/memory-hygiene in huytieu/COG-second-brain) into .agents/skills/memory-hygiene in your project. Codex loads it when a task matches its description.

Can I use Memory Hygiene in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add huytieu/COG-second-brain --skill memory-hygiene -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/memory-hygiene, .gemini/skills/memory-hygiene, .github/skills/memory-hygiene and .opencode/skills/memory-hygiene in your project.

What does Memory Hygiene need to run?

Going by SKILL.md and its folder, Memory Hygiene needs the command-line tools its instructions call (curl, gh and git).

Does Memory Hygiene access the network?

SKILL.md contains no URLs. Its commands use curl, gh and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Memory Hygiene safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Memory Hygiene use?

Memory Hygiene is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Memory Hygiene use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Memory Hygiene?

Skills that share tags, products or a category with Memory Hygiene: Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars), Beads Task Memory (gastownhall/beads, 28k stars), Reflect on Session Learnings (cursor/plugins, 10k stars) and MemPalace Memory Search (MemPalace/mempalace, 59k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Memory Hygiene?

huytieu (a GitHub user) maintains it in huytieu/COG-second-brain, which has 1,267 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on October 2, 2026.

Source: huytieu/COG-second-brain on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.