memory-maintenance

memory-maintenance is a skill for Claude Code from rjmurillo/ai-agents. It costs 90 tokens per session (1,957 once invoked), scanned A, original, MIT.

A set of maintenance checks for a project's memory systems. It measures their health, storage cost, record size, graph density, and retrieval performance using the project's standard scripts.

In plain words
What is it for?
Use it to check memory health, count the tokens used by a memory, validate record size, improve graph density, or benchmark search performance.
Why use it?
Memory can become too large, slow, fragmented, or unavailable in one of its storage layers. These checks show where the memory system needs attention.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT variable. Also seen: reads .claude/ paths.

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 project-toolkit plugin — 125 skills, 25 commands, 33 agents, 5 hooks shipped together

Good fit Use it to check memory health, count the tokens used by a memory, validate record size, improve graph density, or benchmark search performance.

Compare 6 skills from other repositories ↓
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 rjmurillo/ai-agents
Claude Code
/plugin install project-toolkit

Made for: Claude Code.

Or install project-toolkit, the plugin that ships this one along with the rest of its 125 skills, 25 commands, 33 agents, 5 hooks.

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-maintenance

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/rjmurillo/ai-agents/memory-maintenance"><img src="https://agentmods.dev/badge/skills/rjmurillo/ai-agents/memory-maintenance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,957 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.00090 $0.01957
Opus 5.5 $0.00036 $0.00783
Sonnet 5.5 $0.00018 $0.00391
Haiku 4.5 $0.00009 $0.00196

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

Security

Grade A, and why

memory-maintenance 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 22d 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.

.claude/skills/memory-maintenance/SKILL.md · 214 lines

How it starts

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

Memory Maintenance

Health, budget, atomicity, and performance operations for the memory system, extracted from the memory router per ADR-063 (memory-skill decomposition). memory still routes here; an agent that only needs to check system health or count a memory's token cost loads this sub-skill instead of the full router.

Maintenance is a family of read-mostly checks over the memory stores. Every operation delegates to a canonical script under .claude/skills/memory/scripts/; this sub-skill owns the operator guidance, not the script implementations. The scripts are shared with the router and are not reimplemented here.

Triggers

Use this skill when the user says:

  • check memory health for the tier-availability dashboard
  • count memory tokens for retrieval budget analysis
  • benchmark memory performance for Serena search latency

Quick Start

SCRIPTS_DIR="${COPILOT_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-.claude}}/skills/memory/scripts"

# System health across all tiers
python3 "$SCRIPTS_DIR/test_memory_health.py" --format table

# Token cost of a memory before you retrieve it
python3 "$SCRIPTS_DIR/count_memory_tokens.py" <memory-file>

# Atomicity size validation (pre-commit gate)
python3 "$SCRIPTS_DIR/test_memory_size.py" <memory-dir> --pattern "*.md"

# Performance benchmark (Serena lexical search, by phase)
python3 "$SCRIPTS_DIR/measure_memory_performance.py" --format table

The canonical scripts live at .claude/skills/memory/scripts/test_memory_health.py, .claude/skills/memory/scripts/count_memory_tokens.py, and their siblings. This sub-skill delegates to them and does not reimplement any check.

Operations

Operation Script Key Parameters
Health check test_memory_health.py --format (json/table)
Token count count_memory_tokens.py <memory-file>
Size validation test_memory_size.py <memory-dir>, --pattern
Benchmark performance measure_memory_performance.py --iterations, --warmup, --format
Improve graph density improve_memory_graph_density.py --memory-path, --dry-run
Cross-reference invoke_memory_cross_reference.py --memory-path, --threshold
Convert index links convert_index_table_links.py --memory-path, --dry-run

Read the full file on GitHub · 214 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 22d ago Changed · +5 lines 755ce9706b46
  2. 25d ago Changed · +2 lines 9afcda59d180
  3. 1mo ago Changed a5b1bb317e06
  4. 1mo ago Changed 52572d4816a9
  5. 1mo ago First seen · 207 lines · 90 tokens per session scan A c588145a1a2f

Subscribe to this mod's changes

memory-maintenance is a skill published in the GitHub repository rjmurillo/ai-agents (48 stars, last pushed today), licensed MIT. It adds 90 tokens to every session and 1,957 once invoked, about $0.0004 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-09-03.