memory-compress

memory-compress is a command for Claude Code from noizu-labs-ml/NoizuPromptLingo. It costs 79 tokens per session (1,148 once invoked), scanned A, original, MIT.

A maintenance command for a project's persistent memory files. It merges duplicate notes, removes stale or unverifiable information, tightens wording, and shrinks the memory index.

In plain words
What is it for?
Use it periodically, or when project memory feels bloated, to review the memory index and its linked files without changing normal memory-saving behavior.
Why use it?
Long-lived agent memory can become repetitive, outdated, or noisy; this command keeps the information loaded into future conversations smaller and more useful.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: mentions CLAUDE.md.

Good fit Use it periodically, or when project memory feels bloated, to review the memory index and its linked files without changing normal memory-saving behavior.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/noizu-labs-ml/noizupromptlingo/memory-compress
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.

Clone the repo
git clone --depth 1 https://github.com/noizu-labs-ml/NoizuPromptLingo

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/noizu-labs-ml/noizupromptlingo/memory-compress/github.svg)](https://agentmods.dev/commands/noizu-labs-ml/noizupromptlingo/memory-compress)
Your own site
<a href="https://agentmods.dev/commands/noizu-labs-ml/noizupromptlingo/memory-compress"><img src="https://agentmods.dev/badge/commands/noizu-labs-ml/noizupromptlingo/memory-compress/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-compress

Your own site · 80×15
<a href="https://agentmods.dev/commands/noizu-labs-ml/noizupromptlingo/memory-compress"><img src="https://agentmods.dev/badge/commands/noizu-labs-ml/noizupromptlingo/memory-compress.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,148 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.
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.00079 $0.01148
Opus 5 $0.00039 $0.00574
Sonnet 5 $0.00016 $0.00230
Haiku 4.5 $0.00008 $0.00115

Measured 5d ago against content hash 7c76f5c495e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

memory-compress 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 5d 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.

commands/memory-compress.md · 90 lines

How it starts

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

Memory Compression

Maintenance pass over the persistent memory system at <project-memory-dir>/MEMORY.md and its linked files. Goal: keep memory small, current, and load-bearing — every line still in MEMORY.md after this pass must earn its place in every future conversation's context.

This command does not change what gets saved during normal conversation (see the memory instructions in the system prompt for that). It only compacts what has already accumulated.

Procedure

  1. Load the index. Read MEMORY.md in the current project's memory directory. If it doesn't exist or is empty, report that there's nothing to compress and stop.

  2. Read every linked file. For each - [Title](file.md) — hook line, read file.md in full, including its frontmatter (name, description, metadata.type).

  3. Score each memory against these removal/merge criteria:

    • Duplicate or overlapping — two files cover the same fact/rule with only wording differences → merge into one, keep the clearer Why/How to apply, delete the other, update its [[links]] references.
    • Superseded — a newer memory contradicts an older one (e.g. a feedback memory that reverses an earlier one) → keep only the current version; delete the stale one rather than stacking corrections.
    • Expired project memory — dates, deadlines, or "in-progress" state that has clearly passed relative to today's date, with no indication it's still relevant → delete. If the file and the current date, run a quick reality check first (see step 4).
    • Verifiable but unverified claims — a memory naming a specific file, function, flag, or config value that hasn't been checked recently enough to trust → do NOT delete solely for this; instead spot-check (step 4) and update or flag it.
    • Over-verbose — correct and still relevant, but padded with restated context or hedging → rewrite tersely in place, don't delete.
    • Never-referenced trivia — content that reads as a debugging recipe, code-pattern note, or something derivable by reading the repo (excluded categories per the memory system's own rules) → delete outright, it should never have been saved.

Read the full file on GitHub · 90 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. 5d ago First seen · 90 lines · 79 tokens per session scan A 7c76f5c495e8

Subscribe to this mod's changes

memory-compress is a command published in the GitHub repository noizu-labs-ml/NoizuPromptLingo (13 stars, last pushed today), licensed MIT. It adds 79 tokens to every session and 1,148 once invoked, about $0.0004 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-09-04.