squid-clean-memory

squid-clean-memory is a skill for Claude Code, Codex from iusztinpaul/squid. It costs 53 tokens per session (1,263 once invoked), scanned A, original, Apache-2.0.

A memory-cleaning skill for shortening AGENTS.md and CLAUDE.md instruction files while preserving their meaning. These files contain rules that coding agents load as project guidance.

In plain words
What is it for?
Use it to find tracked memory files, remove repetition and harness-enforced wording, merge fragments, and apply approved cleanup passes as separate commits.
Why use it?
Long or duplicated instructions consume context and make important rules harder to find. The skill first produces a reviewable plan before applying changes.

Skill for Claude CodeCodex

Part of the squid plugin — 15 skills, 5 agents shipped together

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 skills/iusztinpaul/squid/squid-clean-memory
Any agent
npx skills add iusztinpaul/squid --skill squid-clean-memory
Clone the repo
git clone --depth 1 https://github.com/iusztinpaul/squid

Made for: Claude Code, Codex.

Or install squid, the plugin that ships this one along with the rest of its 15 skills, 5 agents.

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 squid-clean-memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/iusztinpaul/squid/squid-clean-memory.svg)](https://agentmods.dev/skills/iusztinpaul/squid/squid-clean-memory)
Your own site
<a href="https://agentmods.dev/skills/iusztinpaul/squid/squid-clean-memory"><img src="https://agentmods.dev/badge/skills/iusztinpaul/squid/squid-clean-memory.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,263 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.1 $0.00053 $0.01263
Opus 5 $0.00026 $0.00632
Sonnet 5 $0.00011 $0.00253
Haiku 4.5 $0.00005 $0.00126

Measured today against content hash f10760893da8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

squid-clean-memory 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 today.

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.

skills/squid-clean-memory/SKILL.md · 100 lines

How it starts

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

Clean memory — same rules, minimum words

You are the cleaner. You shrink the memory files sessions load; you do not change what they instruct. Zero meaning diff is the contract — every rule that holds before must hold after, and no new rule may appear.

$ARGUMENTS is an optional file or directory scope. Empty means every memory file in the repo: the root AGENTS.md plus each nested AGENTS.md / CLAUDE.md. Where CLAUDE.md symlinks AGENTS.md, that is one file — edit the target, never replace the symlink with a copy.

When NOT to use

  • Docs, READMEs, comments, docstrings → /squid-clean-docs.
  • A rule you think is wrong — that is a deliberate edit to make with the user, not a cleanup.

Step 1 — Resolve the target set

Discover the set with git ls-files '*AGENTS.md' '*CLAUDE.md' (tracked files only, so vendored trees stay out), narrow to $ARGUMENTS if given, and collapse symlink pairs. The files must be clean in git.

Step 2 — Compress wording (caveman pass)

If the caveman plugin is installed, ask, then run /caveman-compress <file> on each file in the set and commit the pass as one commit (code, paths, and URLs are byte-preserved). Compress before cutting: normalised wording turns reworded duplicates into literal ones. Not installed → skip; the cuts below still shrink the files, just without the wording-level pass.

Step 3 — Apply the keep/delete test

A memory line survives only if deleting it would change how a future session behaves. Three cuts:

Duplicates — the same instruction stated twice, even reworded — in one file or across the set: a nested AGENTS.md repeating the root dies where it's nested, since the root already loads everywhere. Keep one home, delete the copies; leave a cross-reference only when the section survives without it. Moving a rule between files (root ↔ nested) changes where it applies — that is a scope edit, not a cleanup: flag it in the plan, never fold it into a dedupe.

Baked-in claims — the test: would a fresh session with an empty memory file already behave this way? If yes, the line is dead weight. Caution: AGENTS.md is read by non-Claude harnesses too — if the behaviour is a Claude Code default rather than universal, keep the line and flag it in the plan.

Read the full file on GitHub · 100 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. today Changed · -8 lines f10760893da8
  2. 6d ago First seen · 108 lines · 53 tokens per session scan A c228c4984755

Subscribe to this mod's changes

squid-clean-memory is a skill published in the GitHub repository iusztinpaul/squid (184 stars, last pushed 2d ago), licensed Apache-2.0. It adds 53 tokens to every session and 1,263 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

digital-brain

This skill should be used when the user asks to "write a post", "check my voice", "look up contact", "prepare for meeting", "weekly review", "track goals", or mentions personal brand, content creation, network management, or voice consistency.

foryourhealth111-pixel/Vibe-Skills · 57 tokens

agent-expert-creation

Create specialized agent experts with pre-loaded domain knowledge using the Act-Learn-Reuse pattern. Use when building domain-specific agents that maintain mental models via expertise files and self-improve prompts.

majiayu000/claude-skill-registry · 43 tokens

agent-assistant

Agent assistance skill that provides stuck detection, memory management, and session learning capabilities for AI agents Trigger terms: agent stuck, loop detected, session memory, agent learning, condense memory, stuck detection, agent memory, session learnings, extraction Use when: User reports agent is stuck…

majiayu000/claude-skill-registry · 72 tokens

auto-dream

Background memory consolidation — overnight review, merge, and injection payload for memory files.

notque/vexjoy-agent · 20 tokens

ac-memory-manager

Manage persistent memory for autonomous coding. Use when storing/retrieving knowledge, managing Graphiti integration, persisting learnings, or accessing episodic memory.

majiayu000/claude-skill-registry · 35 tokens

ac-knowledge-graph

Manage knowledge graph for autonomous coding. Use when storing relationships, querying connected knowledge, building project understanding, or maintaining semantic memory.

majiayu000/claude-skill-registry · 31 tokens