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.
npx skills add vinta/hal-9000 --skill refactor-memorygit clone --depth 1 https://github.com/vinta/hal-9000Wrote 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.
[](https://agentmods.dev/skills/vinta/hal-9000/refactor-memory)<a href="https://agentmods.dev/skills/vinta/hal-9000/refactor-memory"><img src="https://agentmods.dev/badge/skills/vinta/hal-9000/refactor-memory.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 3 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 Tool Misuse · line 16 Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
- medium Rogue Agent · line 31 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 Excessive Agency · line 40 Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00064 | $0.01116 |
| Opus 5 | $0.00032 | $0.00558 |
| Sonnet 5 | $0.00013 | $0.00223 |
| Haiku 4.5 | $0.00006 | $0.00112 |
Grade A, and why
refactor-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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Overview
Refactor a project's auto memory. MEMORY.md is loaded into every session and each topic file is read on recall, so a memory earns its place only by carrying what no lookup returns: a decision, a correction, a measured gotcha. Everything else spends index lines and recall attention on facts that change no future action.
Instructions
-
Pick the target. If the invocation names a directory, use it. Otherwise use the memory directory named in this session's system prompt, the one holding
MEMORY.md. ReadMEMORY.md, every topic file, and what the audit compares against: the loaded CLAUDE.md files,.claude/rules/, and~/.claude/rules/. -
Fetch the yardstick. Fetch https://code.claude.com/docs/en/memory#auto-memory for the current index load limits, the memory types, and what auto memory is meant to skip.
-
Audit topic files. Give every topic file exactly one verdict, with the evidence beside it. Done when no file lacks one.
- contradiction: conflicts with another memory, or with the current state of the rule, CLAUDE.md line, or code it describes. Record both sides.
- delete: no future action depends on it. Covers a memory whose tracked work is done or whose question is settled, and a memory the agent could look up when it matters: in the code, git history, a loaded CLAUDE.md or rules file, or the vendor docs. Check each such claim by looking, not from memory: grep the repo, read the rule, fetch the docs page, since a gotcha measured months ago may be documented now. Delete outright, never rewrite into a done or synced record.
- rewrite: right fact, wrong form: the index hook or
descriptiondisagrees with the body; a[[link]]names a filename or a slug no memory carries, since links target thename:field; a relative date; two files carrying one fact, which merge into one. - promote: a
feedbackorprojectmemory that is really a standing instruction. Destination by scope: the project CLAUDE.md when it applies to every task in this project,~/.claude/CLAUDE.mdwhen it applies in every project, and in both cases only if it passes that file's keep bar in therefactor-claude-mdskill, since the line is loaded into every session; apaths:-scoped file in.claude/rules/or~/.claude/rules/when it applies to some paths; a skill when it is a multi-step workflow. Areferencememory about how a tool behaves stays a memory, since rules record decisions, not tool behavior. Name the destination. - keep: earns its index line and recall cost as written.
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.
- 2d ago First seen · 41 lines · 64 tokens per session scan A 0ede79482efa
refactor-memory is a skill published in the GitHub repository vinta/hal-9000 (128 stars, last pushed today), licensed MIT. It adds 64 tokens to every session and 1,116 once invoked, about $0.0003 per session on Opus 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-05.
Other skills, from other repositories
memory
Split memory system with USER.md for durable personal profile and MEMORY.md for token-budgeted operational context.
knowledge-audit
Review and clean up stored memories — find duplicates, contradictions, stale entries, and consolidate.
temporal-query
Answer time-travel questions over stored memory — what was believed at a past point in time, when a belief changed, and what replaced it. Use when the user says "as of", "back in", "at the time", "history of", "timeline", "what did I think then", or asks why a current memory contradicts an older one.
memory-commit
Use when the user explicitly says "remember this", "save this", "ghi nho", "luu lai", "save for next time", or otherwise asks to persist the immediately preceding context. Captures with the appropriate contexttype (decision, preference, fact, skill, task, conversation) so future sessions can retrieve it accurately.
recall-context
Use at session start, before significant decisions, or when a new task references a known project to recall mnemo memories matching the current working directory, recently edited files, or topic keywords. Helps maintain continuity across sessions and avoid redoing past research.
passport-bootstrap
Use when the user installs mnemo-mcp on a fresh machine and wants to restore prior memory state from S3 or Google Drive (Phase 2 passport sync). Triggers on phrases like "set up mnemo on this machine", "restore my memory passport", "import passport", "bootstrap mnemo", or when the user says they got a new laptop / VM…