memory-inspect

memory-inspect is a skill for Claude Code from fjpulidop/specrails-core. It costs 44 tokens per session (2,084 once invoked), scanned C, original, MIT.

A tool for inspecting memory folders used by OpenSpec agents, where OpenSpec is a system for managing software changes through documented workflows. It shows stored files, sizes, recent entries, and old or unused files.

In plain words
What is it for?
Use it to inspect one agent's memory, review all agent memory stores, find files older than a chosen number of days, and optionally prune them.
Why use it?
It makes agent memory easier to inspect and helps identify stale or abandoned stored information. It can also remove stale files after confirmation.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions CLAUDE.md.

Part of the specrails plugin — 28 skills, 14 agents shipped together

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.

agentmods
npx agentmods add skills/fjpulidop/specrails-core/memory-inspect
Any agent
npx skills add fjpulidop/specrails-core --skill memory-inspect
Clone the repo
git clone --depth 1 https://github.com/fjpulidop/specrails-core

Made for: Claude Code.

Or install specrails, the plugin that ships this one along with the rest of its 28 skills, 14 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 memory-inspect

README.md
[![agentmods](https://agentmods.dev/badge/skills/fjpulidop/specrails-core/memory-inspect.svg)](https://agentmods.dev/skills/fjpulidop/specrails-core/memory-inspect)
Your own site
<a href="https://agentmods.dev/skills/fjpulidop/specrails-core/memory-inspect"><img src="https://agentmods.dev/badge/skills/fjpulidop/specrails-core/memory-inspect.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,084 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00044 $0.02084
Opus 5 $0.00022 $0.01042
Sonnet 5 $0.00009 $0.00417
Haiku 4.5 $0.00004 $0.00208

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

Security

Grade C, and why

memory-inspect scanned grade C 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf .claude/agent-memory/<agent-name>/
specrails-plugin/skills/memory-inspect/SKILL.md · 263 lines

How it starts

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

Inspect agent memory directories under .claude/agent-memory/sr-*/ for this project (read name from CLAUDE.md or package.json). Show per-agent stats, recent entries, and actionable recommendations.

Input: $ARGUMENTS — optional:

  • <agent-name> — inspect a specific agent's memory (e.g. sr-developer, sr-reviewer)
  • --stale <days> — flag files not modified in more than N days as stale (default: 30)
  • --prune — delete stale files after confirmation (prints the list first, then asks)

Phase 0: Argument Parsing

Parse $ARGUMENTS to set runtime variables.

Variables to set:

  • AGENT_FILTER — string or empty string. Default: "" (inspect all agents).
  • STALE_DAYS — integer. Default: 30.
  • PRUNE_MODE — boolean. Default: false.

Parsing rules:

  1. Scan $ARGUMENTS for --stale <N>. If found, set STALE_DAYS=<N>. Validate that <N> is a positive integer; if not, print Error: --stale requires a positive integer (e.g. --stale 14) and stop. Strip from arguments.
  2. Scan for --prune. If found, set PRUNE_MODE=true. Strip from arguments.
  3. Remaining non-flag text (if any) is treated as AGENT_FILTER. Strip leading/trailing whitespace.

Print active configuration:

Scanning: <all agents | agent: AGENT_FILTER> | Stale threshold: STALE_DAYS days | Prune: yes/no

Phase 1: Discover Memory Directories

Glob all directories matching .claude/agent-memory/sr-*/.

If no directories are found:

No agent memory directories found under .claude/agent-memory/.

Agent memory is written by sr-* agents during the /specrails:implement pipeline.
Run /specrails:implement on a feature to generate your first memory entries.

Then stop.

If AGENT_FILTER is set, filter to only the directory .claude/agent-memory/<AGENT_FILTER>/. If that directory does not exist:

No memory directory found for agent: <AGENT_FILTER>

Available agents:
  <list of discovered sr-* directory names>

Then stop.

Set AGENT_DIRS = list of matching directories (full paths), sorted alphabetically.

Read the full file on GitHub · 263 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 · 263 lines · 44 tokens per session scan C c007b6403d3b

Subscribe to this mod's changes

memory-inspect is a skill published in the GitHub repository fjpulidop/specrails-core (9 stars, last pushed 1mo ago), licensed MIT. It adds 44 tokens to every session and 2,084 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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

unified-memory

Share durable, inspectable context and handoffs between Claude, Codex, Hermes, Cursor, OpenCode, and other agents through the local ECC Memory Vault. Use when an agent must save work state, transfer context, resume another agent's task, or search shared project knowledge.

affaan-m/ECC · 60 tokens

strategic-compact

Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction. Use when a session is approaching a context limit and a task phase is a natural place to compact.

affaan-m/ECC · 47 tokens

taiyi-compress

TaiyiForge 辅助 — Token 压缩编排:/taiyi:token compress + Superpowers subagent + ECC strategic-compact / handoff。OpenCode / Claude / Codex / Cursor 通用。.

Dong90/oh-my-taiyiforge · 51 tokens

agents-md-improver

Audit and improve project-rules files (AGENTS.md, CLAUDE.md, .agents/instructions, local overrides) so the agent keeps accurate project context. Use when the user asks to check, audit, review, update, improve, or fix their AGENTS.md or CLAUDE.md, mentions "project rules maintenance" or "agent context optimization", or…

waybarrios/opencode-power-pack · 125 tokens

agents-md-revise

Capture learnings from the current session into the project-rules file (AGENTS.md, CLAUDE.md, or local override) so future sessions benefit. Use when the user says "revise the rules", "update AGENTS.md / CLAUDE.md with what we just learned", "save this to project memory", "remember this for next time", or at the end…

waybarrios/opencode-power-pack · 114 tokens

token-optimization

Use when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity. Covers TokenStack, the built-in compression proxy that shrinks Claude Code tool output before it reaches the Anthropic API. Do NOT use for…

cwinvestments/memstack · 79 tokens