Squid Clean Memory logo

Squid Clean Memory

Community
iusztinpaul
squid-clean-memory

Shrink the memory files sessions load — the root AGENTS.md plus every nested AGENTS.md / CLAUDE.md — to the minimum words that state the same rules: compress wording, delete duplicates and harness-enforced claims, merge fragments.

Overview

Publisheriusztinpaul
Repositorysquid
Skill namesquid-clean-memory
Stars
207
Forks
34
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by iusztinpaul on GitHub. Read the source before you install it.

Installation

Install the Squid Clean Memory AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/iusztinpaul/squid/tree/main/skills/squid-clean-memory
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/iusztinpaul/squid.git /tmp/squid
mkdir -p .claude/skills
cp -r /tmp/squid/skills/squid-clean-memory .claude/skills/squid-clean-memory
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Squid Clean Memory in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Squid Clean Memory on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Squid Clean Memory is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

DeleteKeep
"Always read a file before modifying it." — harness enforces"Use uv run pytest, never bare pytest." — project decision
"Be concise." / "Don't over-engineer." — system-prompt defaults"Chunk at 200 tokens — the embedding model truncates above 256."
Install steps under both Setup and Contributing — one home"Never edit docs/adr/ — ADRs are immutable."

Merges — two sections merge when a reader never needs one without the other, or a section is a few lines sharing a topic with its neighbour. A 3-line Code style plus a 2-line Naming become one Conventions; a heading costs more attention than it organises.

Step 4 — Plan of attack (the output artifact)

Print one table in chat. Do not write it to disk unless the user asks.

FileLines / sectionCut (Step 3)Why~Words
AGENTS.md"read before you edit"baked-inharness enforces it−9
api/AGENTS.md"use uv run, never pip"duplicateroot already states it−11
AGENTS.mdCode style + Namingmergealways read together−12

Stop and wait for explicit approval. Do not edit before it.

Step 5 — Execute

Apply the approved plan as one commit, separate from the Step 2 commit.

Step 6 — Verify

Meaning must be provably unchanged before hand-off:

  • Re-read each final file against its pre-clean version: every old rule is still stated in a file that loads wherever the rule applied, merged, or a planned deletion — name its new home.
  • Every path, command, and URL in the files still resolves.
  • git diff touches only memory files.

Anything off: revert that commit, do not "fix forward".

Step 7 — Hand-off

Report wc -w before → after per file. Then ask the user to run /doctor (Claude Code only — a built-in you cannot invoke): Step 1 scopes this pass to tracked files, so the always-loaded local ones — ~/.claude/CLAUDE.md, CLAUDE.local.md — are never reached here; /doctor dedupes those against the checked-in set.

Notes on shape

  • Fewer words, never fewer rules. If a cut loses a nuance, it is an edit — out of scope.

Frequently asked questions

What does the Squid Clean Memory AI skill do?

Shrink the memory files sessions load — the root AGENTS.md plus every nested AGENTS.md / CLAUDE.md — to the minimum words that state the same rules: compress wording, delete duplicates and harness-enforced claims, merge fragments.

Why use Squid Clean Memory on TypingMind?

Because you install it once and use it with any model. Squid Clean Memory is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Squid Clean Memory in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/iusztinpaul/squid/tree/main/skills/squid-clean-memory. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Squid Clean Memory?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Squid Clean Memory?

As many as you like. As long as a model supports skills, you can use Squid Clean Memory with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Squid Clean Memory AI skill free?

Yes. It is published on GitHub by iusztinpaul under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇