mempenny: Command for Claude Code

.opencode/commands/mempenny-clean.md

mempenny-clean is a command for Claude Code, OpenCode from marcelopaniza/mempenny. It costs 35 tokens per session (995 once invoked), scanned C, original, MIT.

A one-command cleanup process for automatic project memory that first reviews items and then applies the approved actions.

In plain words
What is it for?
Use it when you want to remove, archive, condense, or retain memory entries in one pass. It is an adapter for the OpenCode coding environment.
Why use it?
It combines review and cleanup while keeping backups, reusing the chosen backup location, and applying safety checks from the full cleanup procedure.

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-clean.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-clean

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/marcelopaniza/mempenny/mempenny-clean"><img src="https://agentmods.dev/badge/commands/marcelopaniza/mempenny/mempenny-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 995 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00035 $0.00995
Opus 5 $0.00017 $0.00498
Sonnet 5 $0.00007 $0.00199
Haiku 4.5 $0.00003 $0.00100

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

Security

Grade C, and why

mempenny-clean scanned grade C with 2 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 10d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Apply the source's F-M2 symlink guard and L1 `chmod 600` on every read/write of this path, exactly as written there.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

opencode has no auto-memory feature. **Skip the `~/.claude/settings.json` → `autoMemoryEnabled` detection and offer entirely.** Treat `auto_memory_now_on=false` and suppress the empty-dir signal that step would set.
.opencode/commands/mempenny-clean.md · 54 lines

How it starts

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

MemPenny clean — opencode host adapter

The user invoked this command with: $ARGUMENTS

Execute the MemPenny clean flow. The canonical procedure lives in:

${MEMPENNY_ROOT}/commands/clean.md

Read it first with the Read tool — it is the single source of truth for every step, guard, locale key, migration rule, and conservation check. The 4,000-line procedure lives there; this file only describes the opencode host differences.

While executing the source procedure, apply these opencode host adaptations (override the source wherever they conflict):

A. Paths & environment

The env shim (.opencode/plugins/mempenny-env.ts) already sets MEMPENNY_HOST=opencode, MEMPENNY_ROOT, and MEMPENNY_DATA_DIR. Substitute every Claude Code env var in the source as follows:

  • ${CLAUDE_PLUGIN_ROOT}${MEMPENNY_ROOT} (locales live at ${MEMPENNY_ROOT}/locales/<lang>/strings.json)
  • ${CLAUDE_PLUGIN_DATA}${MEMPENNY_DATA_DIR} (~/.local/share/mempenny)
  • ${CLAUDE_PROJECT_DIR} → the current working directory

B. Config path (host-aware — shared with Claude Code)

  1. If ${MEMPENNY_CONFIG_PATH} is set → use it.
  2. Else if ~/.claude/ exists → ~/.claude/mempenny.config.json (shared — zero setup if you run both hosts).
  3. Else → ~/.config/opencode/mempenny.config.json.

Apply the source's F-M2 symlink guard and L1 chmod 600 on every read/write of this path, exactly as written there.

C. Auto-memory (Claude Code-only feature)

opencode has no auto-memory feature. Skip the ~/.claude/settings.jsonautoMemoryEnabled detection and offer entirely. Treat auto_memory_now_on=false and suppress the empty-dir signal that step would set.

D. Subagents (opencode Task tool)

The source spawns subagents with Claude Code syntax. Use opencode's Task tool instead:

  • subagent_type: "explore" (read-only) where the source says Explore.
  • subagent_type: "general" where the source says general-purpose.
  • Lowercase. Pass description + prompt.
  • Leave model unset (inherit the host model) unless the user exported MEMPENNY_TRIAGE_MODEL, in which case pass that value as model.

Read the full file on GitHub · 54 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. 10d ago First seen · 54 lines · 35 tokens per session scan C c9e6922919b1

Subscribe to this mod's changes

mempenny-clean is a command published in the GitHub repository marcelopaniza/mempenny (2 stars, last pushed 21d ago), licensed MIT. It adds 35 tokens to every session and 995 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (asks for root, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other commands, from other repositories

remember

Stores decisions, patterns, and outcomes in the MCP memory knowledge graph as entities with typed observations and relations. Supports recording architectural decisions, anti-patterns, tool preferences, workflow outcomes, and project conventions that persist across sessions. Use when saving patterns, remembering…

yonatangross/orchestkit · 62 tokens

memory

Unified read-side memory operations including knowledge graph search, session context loading, decision timeline viewing, and Mermaid graph visualization. Subcommands: search, load, history, viz, status. Complements /ork:remember (write-side). Use when searching past decisions, loading context, or visualizing the…

yonatangross/orchestkit · 64 tokens

dream

Nightly memory consolidation — prunes stale entries, merges duplicates, resolves contradictions, rebuilds MEMORY.md index. Use when memory files have accumulated over many sessions and need cleanup. Do NOT use for storing new decisions (use remember) or searching memory (use memory).

yonatangross/orchestkit · 55 tokens

mempalace-init

Set up MemPalace — install the package, initialize a palace, register the MCP server with Cursor, and verify everything works.

MemPalace/mempalace · 26 tokens

mempalace-status

Show the current state of your memory palace — wings, rooms, drawer counts, and suggestions.

MemPalace/mempalace · 19 tokens

ingest

Ingest source material into an active wiki. Accepts URLs, file paths, PDFs, freeform text, or processes the inbox. Supports tweets via Grok MCP.

nvk/llm-wiki · 34 tokens