persistent-memory

persistent-memory is a skill for Claude Code from mthines/agent-skills. It costs 244 tokens per session (3,469 once invoked), scanned A, original, MIT.

A plain-markdown memory system that saves and retrieves conversation context under named topics, such as work or a project. It can also combine, list, or remove stored memories.

In plain words
What is it for?
Use it to remember new information, recall past context, consolidate notes, list memory topics, or forget stored details.
Why use it?
It prevents useful context from being lost between conversations and lets you control which topic-specific information is retained.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: positional $N argument; mentions Claude Code.

Part of the mthines-agent-skills plugin — 57 skills, 5 agents shipped together

Good fit Use it to remember new information, recall past context, consolidate notes, list memory topics, or forget stored details.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mthines/agent-skills/persistent-memory
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.

Any agent
npx skills add mthines/agent-skills --skill persistent-memory
Clone the repo
git clone --depth 1 https://github.com/mthines/agent-skills

Made for: Claude Code.

Or install mthines-agent-skills, the plugin that ships this one along with the rest of its 57 skills, 5 agents.

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 persistent-memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/mthines/agent-skills/persistent-memory/github.svg)](https://agentmods.dev/skills/mthines/agent-skills/persistent-memory)
Your own site
<a href="https://agentmods.dev/skills/mthines/agent-skills/persistent-memory"><img src="https://agentmods.dev/badge/skills/mthines/agent-skills/persistent-memory/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 persistent-memory

Your own site · 80×15
<a href="https://agentmods.dev/skills/mthines/agent-skills/persistent-memory"><img src="https://agentmods.dev/badge/skills/mthines/agent-skills/persistent-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 244 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,469 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Memory Poisoning · line 69
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
  • medium Prompt Injection · line 89
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Rogue Agent · line 76
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Rogue Agent · line 234
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00244 $0.03469
Opus 5.5 $0.00098 $0.01388
Sonnet 5.5 $0.00049 $0.00694
Haiku 4.5 $0.00024 $0.00347

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

Security

Grade A, and why

persistent-memory 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 25d 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.

skills/authoring/persistent-memory/SKILL.md · 280 lines

How it starts

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

Persistent Memory

Capture, recall, consolidate, and forget memories scoped to a user-chosen topic (e.g. parenting, work, relationship-anna) as plain markdown files, so any future conversation can pick up where the last one left off.

This SKILL.md is a thin index. Operation pipelines, taxonomy, privacy rules, integration patterns, and scaling guidance live in rules/*.md and load on demand. Literal artefact templates live in templates/*.md. Worked examples and citations live in references/*.md. Read only what the current operation asks for.


Mode Detection

Parse $ARGUMENTS (first token) and detect the operation:

Operation Default Trigger phrases
write yes "remember", "save to memory", "add to memory", $0 == "write"
read "recall", "load memory", "what do you remember about", $0 == "read"
consolidate "consolidate memory", "compress memory", $0 == "consolidate"
forget "forget that", "delete memory", "redact", $0 == "forget"
list "list memory", "what scopes do I have", $0 == "list"

State the detected operation and resolved scope in one line before continuing. Example:

Operation: write
Scope: parenting
Storage tier: home (~/.agent-memory/parenting/)

If no scope is provided, ask once (single batched message) — never guess.


Required Reading by Operation

Load on demand — do not preload.

Operation Files
write rules/storage-layout.md, rules/write-pipeline.md, rules/memory-taxonomy.md, rules/privacy-and-consent.md
read rules/storage-layout.md, rules/read-pipeline.md
consolidate rules/consolidate-pipeline.md, rules/memory-taxonomy.md
forget rules/forget-pipeline.md, rules/privacy-and-consent.md
list rules/storage-layout.md
integration rules/integration-with-skills.md
scaling rules/scaling-tiers.md
pre-flight rules/quality-checklist.md, rules/anti-patterns.md

Read the full file on GitHub · 280 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. 25d ago Changed · -8 lines · -131 tokens per session 5deeb09a950b
  2. 1mo ago First seen · 288 lines · 375 tokens per session scan A 28fd366f7e60

Subscribe to this mod's changes

persistent-memory is a skill published in the GitHub repository mthines/agent-skills (19 stars, last pushed today), licensed MIT. It adds 244 tokens to every session and 3,469 once invoked, about $0.0010 per session on Opus 5.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.

Related

Other skills, from other repositories

continuous-learning-v2

Use when designing a fine-grained, hook-driven learning system that observes every tool call (not just session end), stores atomic "instincts" with confidence scores, and evolves clusters of related instincts into skills, commands, or agents — with project-scoped vs. global separation so React conventions don't leak…

shennawardana23/skillme · 123 tokens

opencode-memory

Browse local OpenCode history: sessions, messages, plans, prompt history, and prior decisions. Use when the user says history, previous session, last time, remember, recall, plans, prior work, or when resuming/debugging repeated work where earlier OpenCode context may help. Do not use for fresh tasks or when current…

carson2222/skills · 77 tokens

context-engineering

Deliberately curate what an agent sees, when, and how it's structured, to keep output quality high across a session. Use when starting a new coding session, when agent output quality is degrading (hallucinated APIs, ignored conventions), when switching between unrelated parts of a codebase, or when setting up a new…

shennawardana23/skillme · 72 tokens

agent-drift-and-re-anchoring

Use when a long-running agent session has drifted from its original goal, when reviewing why an agent kept working on something it wasn't asked to do, when designing checkpoint or re-anchoring behavior for an autonomous/long-horizon agent loop, or when asked about "agent focus", "agent losing the plot", or preventing…

shennawardana23/skillme · 82 tokens

strategic-compact

Use when deciding whether to manually compact conversation context now versus later — at a phase boundary (research done, plan written, milestone shipped), before switching to an unrelated task, or when responses feel slower/less coherent from context pressure. Trigger phrases include "should I compact now", "context…

shennawardana23/skillme · 103 tokens

learn-from-experience

Learn from experience: self-reflection + self-criticism + self-learning + self-organizing memory + cross-session sync. Agent evaluates its own work, catches mistakes, and improves permanently. Compiles confirmed learnings to global config for automatic cross-session persistence. Use when (1) a command, tool, API, or…

shibing624/skills · 123 tokens