memory-auto-split

memory-auto-split is a command for coding agents from marcelopaniza/mempenny. It costs 75 tokens per session (5,197 once invoked), scanned A, original, MIT.

A MemPenny command that splits an oversized memory topic file into an index and linked pages while preserving its content. It handles files that other cleanup commands deliberately leave untouched.

In plain words
What is it for?
Splitting worklogs, support notes, decisions, pending items, or other structured or unstructured memory files when they exceed their size limit.
Why use it?
It provides a growth-control option for pending work, charter documents, and open-year logs that would otherwise keep growing without automatic reduction.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the mempenny plugin — 2 skills, 18 commands, 1 agent, 1 hook 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 commands/marcelopaniza/mempenny/memory-auto-split
Clone the repo
git clone --depth 1 https://github.com/marcelopaniza/mempenny

Or install mempenny, the plugin that ships this one along with the rest of its 2 skills, 18 commands, 1 agent, 1 hook.

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-auto-split

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcelopaniza/mempenny/memory-auto-split.svg)](https://agentmods.dev/commands/marcelopaniza/mempenny/memory-auto-split)
Your own site
<a href="https://agentmods.dev/commands/marcelopaniza/mempenny/memory-auto-split"><img src="https://agentmods.dev/badge/commands/marcelopaniza/mempenny/memory-auto-split.svg" alt="Measured on agentmods" height="20"></a>
Per session 75 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,197 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.00075 $0.05197
Opus 5 $0.00037 $0.02599
Sonnet 5 $0.00015 $0.01039
Haiku 4.5 $0.00007 $0.00520

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

Security

Grade A, and why

memory-auto-split 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.

commands/memory-auto-split.md · 152 lines

How it starts

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

Split an over-ceiling topic file that has no other automated reduction path. This is the gap /mempenny:memory-curate and /mempenny:memory-shard-roll leave open (docs/memory-taxonomy-design.md §2-§4b): curate never touches charter.md/pending.md (no ### entries, and distilling requirements or in-flight work is destructive — correctly so), and shard-roll never touches a year that hasn't fully closed ("no mid-year shards, ever" is shard-roll's own, deliberate pin). Before this command existed, an over-ceiling pending.md (or a log-topic stuck entirely in the open year) had no automatic reduction path at all and just grew forever until a human noticed — see docs/memory-taxonomy-design.md's §4b for the incident that motivated this.

The unifying principle: over ceiling → the main file becomes an INDEX, and the items it used to hold become PAGES the index points at. Three strategies below are three expressions of that one rule, chosen mechanically from what the file actually contains — never guessed, never an LLM judgment call — plus one last-resort fallback for content with no structure to index at all:

  1. DATE (worklog/support/decisions) — the chronological expression. The parent's own ## Shards index block (Step 6, below) IS the index; the locked per-period shard files ARE the pages.
  2. SUBJECT-INDEX (charter/pending, when ## -structured — the primary, real shape of a working pending.md) — the subject expression, and the most direct one: the live file itself becomes the index outright (frontmatter + preamble + one bullet per subject), and every top-level ## block becomes its own detail page.
  3. PROSE-PEEL (charter/pending, only when neither of the above applies) — a last-resort positional split for genuinely structureless prose that still carries datestamps, no index/pages framing, just oldest-vs-newest.
  4. Refuse closed — nothing to safely index, peel, or order; reported for manual trimming.

Unlike curate, this command makes no judgment call about content — it never decides what's worth keeping. It is pure, mechanical, content-preserving relocation. That is what makes it safe to run unattended, even on pending.md: nothing is distilled, archived-by-verdict, or deleted — every byte that leaves the live file is proven to still exist, verbatim, somewhere in the pages.

Step 1 — Parse arguments

The user invoked this command with: $ARGUMENTS

  • First positional argument — absolute path to a topic file. Required.
  • --lang <code> — output language. Default from MEMPENNY_LOCALE or en.

There is no --yes flag and no confirmation gate — see "Why no confirmation gate" under Constraints below; this matches /mempenny:memory-shard-roll, not /mempenny:memory-curate.

Read the full file on GitHub · 152 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 · 152 lines · 75 tokens per session scan A 185fc191e918

Subscribe to this mod's changes

memory-auto-split is a command published in the GitHub repository marcelopaniza/mempenny (2 stars, last pushed 14d ago), licensed MIT. It adds 75 tokens to every session and 5,197 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-08-31.