restore

restore is a command for Claude Code from marcelopaniza/mempenny. It costs 34 tokens per session (5,307 once invoked), scanned B, original, MIT.

A command that restores a saved backup of an agent memory directory.

In plain words
What is it for?
Use it to list backups, choose one or restore the latest backup into a selected memory directory.
Why use it?
It helps recover earlier memory after unwanted changes while first saving the current state so the restore can be undone.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; names the AskUserQuestion tool.

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

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add marcelopaniza/mempenny
Claude Code
/plugin install mempenny

Made for: Claude Code.

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 restore

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcelopaniza/mempenny/restore.svg)](https://agentmods.dev/commands/marcelopaniza/mempenny/restore)
Your own site
<a href="https://agentmods.dev/commands/marcelopaniza/mempenny/restore"><img src="https://agentmods.dev/badge/commands/marcelopaniza/mempenny/restore.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 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,307 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00034 $0.05307
Opus 5 $0.00017 $0.02653
Sonnet 5 $0.00007 $0.01061
Haiku 4.5 $0.00003 $0.00531

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

Security

Grade B, and why

restore scanned grade B with 1 finding 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 6d 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.

**Trust bound:** the MANIFEST file itself is co-located with the backup. An attacker with full write access to the backup dir can modify both the manifest and the files and keep them consistent. The integrity check defen
commands/restore.md · 310 lines

How it starts

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

Restore a previously-taken memory backup. Safe by default: always takes a timestamped snapshot of the current memory dir before overwriting, so a bad restore is itself reversible.

Step 1 — Parse arguments

The user invoked this command with: $ARGUMENTS

  • Positional arg — a specific backup name (e.g., memory.backup-20260417143052) OR the literal word latest. If omitted, we'll list backups and prompt the user interactively.
  • --dir <path> — absolute path to the memory directory to restore INTO. If not set, auto-detect the current project's memory dir (same logic as /mempenny:clean).
  • --lang <code> — output language. Defaults to MEMPENNY_LOCALE or en.

Step 2 — Load locale strings

2a — Validate <lang> before reading (H2: path traversal guard)

Before constructing the locale path, validate that <lang> matches the regex ^[a-zA-Z]{2,3}(-[A-Za-z0-9]{2,8})?$. If it does not match, treat it exactly like a missing locale: silently reset <lang> to en and warn with errors.locale_missing.

Read ${CLAUDE_PLUGIN_ROOT}/locales/<lang>/strings.json. Fall back to en if the file is missing (warn with errors.locale_missing). You need restore.* and errors.* keys.

Step 3 — Locate the target memory directory

If --dir <path> was passed, apply the following validation before using it. On any failure, print errors.memory_dir_not_found and STOP:

Validate --dir <path> (C-class shell-injection guard):

  1. Regex: the candidate path must match ^/[A-Za-z0-9/_.\ -]{1,4096}$ (alphanumerics, slash, underscore, dot, hyphen, space only).
  2. Realpath: run realpath "<candidate>" via Bash. Use the resolved value for all subsequent steps.
  3. Depth: reject if the realpath equals / or has fewer than 2 path components.
  4. Existence + not-a-symlink: [ -d "$resolved" ] && [ ! -L "$resolved" ]. (It's OK if the directory does not exist yet — restore will create it. Skip check 4 if the path does not exist, but still apply checks 1–3.)

Read the full file on GitHub · 310 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. 6d ago First seen · 310 lines · 0 tokens per session scan B 7ed3747d7981

Subscribe to this mod's changes

restore is a command published in the GitHub repository marcelopaniza/mempenny (2 stars, last pushed 17d ago), licensed MIT. It adds 34 tokens to every session and 5,307 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.