mempenny: Command for Claude Code

.opencode/commands/mempenny-memory-shard-roll.md

mempenny-memory-shard-roll is a command for Claude Code, OpenCode from marcelopaniza/mempenny. It costs 44 tokens per session (512 once invoked), scanned A, original, MIT.

An opencode command that moves completed calendar years from an oversized work log, support log, or decision log into separate year-based files. It also updates the original file’s index of archived files.

In plain words
What is it for?
It is for archiving finished years from selected memory logs, checking that the move preserved the content, and updating the parent file’s archive index.
Why use it?
Long log files become difficult for an AI agent to read and maintain. Moving closed years into locked archive files keeps the active file smaller while retaining older records.

Command for Claude CodeOpenCode

Written for Claude Code and OpenCode: ${CLAUDE_PLUGIN_ROOT} variable, but also installed under .opencode/. Also seen: agent in frontmatter; reads .claude/ paths; mentions subagents.

This is marcelopaniza/mempenny's own configuration. It tells Claude Code and OpenCode how to work on mempenny itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mempenny configures →

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the mempenny plugin — 2 skills, 18 commands, 1 agent, 1 hook shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to marcelopaniza/mempenny. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/marcelopaniza/mempenny/main/.opencode/commands/mempenny-memory-shard-roll.md
Clone the repo
git clone --depth 1 https://github.com/marcelopaniza/mempenny

Made for: Claude Code, OpenCode.

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 mempenny-memory-shard-roll

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcelopaniza/mempenny/mempenny-memory-shard-roll/github.svg)](https://agentmods.dev/commands/marcelopaniza/mempenny/mempenny-memory-shard-roll)
Your own site
<a href="https://agentmods.dev/commands/marcelopaniza/mempenny/mempenny-memory-shard-roll"><img src="https://agentmods.dev/badge/commands/marcelopaniza/mempenny/mempenny-memory-shard-roll/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 mempenny-memory-shard-roll

Your own site · 80×15
<a href="https://agentmods.dev/commands/marcelopaniza/mempenny/mempenny-memory-shard-roll"><img src="https://agentmods.dev/badge/commands/marcelopaniza/mempenny/mempenny-memory-shard-roll.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 512 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.00044 $0.00512
Opus 5 $0.00022 $0.00256
Sonnet 5 $0.00009 $0.00102
Haiku 4.5 $0.00004 $0.00051

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

Security

Grade A, and why

mempenny-memory-shard-roll 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 11d 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.

.opencode/commands/mempenny-memory-shard-roll.md · 39 lines

What it actually says

MemPenny memory-shard-roll — opencode host adapter

The user invoked this command with: $ARGUMENTS

Execute the MemPenny memory-shard-roll flow. The canonical procedure lives in:

${MEMPENNY_ROOT}/commands/memory-shard-roll.md

Read it first with the Read tool — it is the single source of truth for the closed-year sharding rule, the locked-shard convention, the scripted conservation check, and the locale keys. This file only describes the opencode host differences.

Apply these opencode host adaptations (override the source wherever they conflict):

A. Paths & environment

The env shim sets MEMPENNY_HOST=opencode, MEMPENNY_ROOT, MEMPENNY_DATA_DIR. Substitute:

  • ${CLAUDE_PLUGIN_ROOT}${MEMPENNY_ROOT}
  • ${CLAUDE_PLUGIN_DATA}${MEMPENNY_DATA_DIR}
  • ${CLAUDE_PROJECT_DIR} → the current working directory

B. Config path (shared with Claude Code)

  1. ${MEMPENNY_CONFIG_PATH} if set.
  2. Else ~/.claude/mempenny.config.json if ~/.claude/ exists.
  3. Else ~/.config/opencode/mempenny.config.json.

C. Subagents (opencode Task tool)

Where the source spawns subagent_type: general-purpose for the isolated write+verify, use opencode's subagent_type: "general" (write-capable), lowercase, with description + prompt. Preserve the separately-spawned-subagent property and the scripted (not judgment-based) conservation check that every relocated line survived — both are what make shard-roll safe to run without a confirmation prompt.

D. Command namespace

Sibling commands use the hyphen namespace.

shard-roll-specific notes

  • The first positional arg is the absolute path to a log-topic file (required); --lang parses from $ARGUMENTS.
  • Shard-roll never writes for content in the current (open) year — it only closes a year that has already ended. Reproduce the source's year-boundary logic exactly.
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. 11d ago First seen · 39 lines · 44 tokens per session scan A c9c957526b2a

Subscribe to this mod's changes

mempenny-memory-shard-roll is a command published in the GitHub repository marcelopaniza/mempenny (2 stars, last pushed 21d ago), licensed MIT. It adds 44 tokens to every session and 512 once invoked, about $0.0002 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.