memory-distill

memory-distill is a command for coding agents from Simple4uhq/sae4u-memory. It costs 0 tokens per session (670 once invoked), scanned A, original, MIT.

A command for reviewing temporary notes and deciding which information should become long-term memory. It lets the user approve, reject, archive, or forget each proposed item.

In plain words
What is it for?
It helps clean up weekly logs, group related notes, update permanent memory files, and keep uncertain items for later review.
Why use it?
It reduces clutter in accumulated notes without silently saving or deleting information.

Command

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.

agentmods
npx agentmods add commands/simple4uhq/sae4u-memory/memory-distill
Clone the repo
git clone --depth 1 https://github.com/Simple4uhq/sae4u-memory

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-distill

README.md
[![agentmods](https://agentmods.dev/badge/commands/simple4uhq/sae4u-memory/memory-distill.svg)](https://agentmods.dev/commands/simple4uhq/sae4u-memory/memory-distill)
Your own site
<a href="https://agentmods.dev/commands/simple4uhq/sae4u-memory/memory-distill"><img src="https://agentmods.dev/badge/commands/simple4uhq/sae4u-memory/memory-distill.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 670 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00670
Opus 5 $0.00000 $0.00335
Sonnet 5 $0.00000 $0.00134
Haiku 4.5 $0.00000 $0.00067

Measured 3d ago against content hash a755bb8ebdf3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-distill 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 3d 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.

sae4u_memory/_assets/commands/memory-distill.md · 72 lines

How it starts

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

/memory-distill — weekly memory cleanup

A periodic ritual: read the rolling tick log, propose promotions to permanent memory, and let the user confirm what to keep, archive, or forget.

When to run

  • Weekly (e.g. Sunday evening or Monday morning).
  • After heavy context-creation periods (a sprint close, a launch).
  • When tick log files have piled up beyond what a quick scan can digest (~5+ days of unmerged ticks).

What it does

  1. Read the tick logs — all files under ~/.sae4u-memory/tick/ that haven't been distilled yet, plus any new permanent files added since last distill.
  2. Cluster by topic (use the 4 types — user/feedback/project/ reference — as a first cut, then group within type by topic).
  3. Propose actions for each cluster. Three outcomes per item:
    • Promote to a permanent file (new or merge into existing). Update MEMORY.md.
    • Drop — was tick-only noise; not worth keeping.
    • Keep in tick log — borderline; see again next week.
  4. Surface for confirmation. The user reviews the proposals and accepts / rejects each. Never auto-promote, never auto-forget — see rules/memory-cleanup-interactive.md.
  5. Apply the confirmed actions:
    • Move tick entries to permanent files
    • Update MEMORY.md index
    • Archive distilled tick log file (e.g. rename to tick/distilled/2026-05-07.md or compress)
  6. Stale check for permanent memory — entries not referenced in N weeks. Ask: "still interesting or forget?" Don't volunteer to delete; just surface the question.

How the AI presents this

Group by topic, not by file. The user shouldn't have to read 40 individual proposals — bundle related ticks into "here are 5 things about X, what shape do you want them in?"

Keep the proposals concrete:

Topic: testing approach

Across 4 ticks last week:

  • 2026-05-02 — "don't mock the database in integration tests"
  • 2026-05-04 — confirmed "TDD for new API endpoints"
  • 2026-05-05 — "use testcontainers for postgres in CI"
  • 2026-05-06 — "snapshot tests OK for component output"

Propose: promote to feedback_testing_approach.md consolidating all four. Drop the per-tick entries from tick log.

Accept / Reject?

Read the full file on GitHub · 72 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. 3d ago First seen · 72 lines · 0 tokens per session scan A a755bb8ebdf3

Subscribe to this mod's changes

memory-distill is a command published in the GitHub repository Simple4uhq/sae4u-memory (0 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 670 tokens. 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.