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/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.
<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="Reviewed on agentmods" width="80" 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.00049 | $0.00778 |
| Opus 5.5 | $0.00020 | $0.00311 |
| Sonnet 5.5 | $0.00010 | $0.00156 |
| Haiku 4.5 | $0.00005 | $0.00078 |
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 20d 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 memories so each entry carries what no lookup returns: a decision, a correction, a measured gotcha. Audit entries within the requested scope; their storage and update mechanism depend on the environment.
Instructions
-
Pick the target. Use the scope or directory the user names, otherwise the platform default below. Load the reference for the active environment before reading memories:
- Claude Code: references/claude-code.md for project memory files, index rules, promotion destinations, and direct edits.
- Codex: references/codex.md for shared storage, project filtering, promotion destinations, and session-authorized updates.
State the storage location and audit scope. A shared directory does not make every entry global.
-
Read the evidence. Follow the reference's reading procedure and fetch its official memory guide. Compare entries against applicable loaded instructions, repository files, and current vendor documentation. Inventory the entries in scope before assigning verdicts.
-
Audit entries. Give every entry exactly one verdict, with its location and evidence beside it. Done when no entry in scope lacks one.
- contradiction: conflicts with another memory, or with the current instruction or code it describes. Record both sides.
- delete: no future action depends on it. Covers completed work, settled questions, and facts recoverable from code, git history, loaded instructions, or vendor docs. Check each claim by looking: search the repo, read the instruction, fetch the docs page. Delete outright, never rewrite into a done or synced record.
- rewrite: right fact, wrong form: a recall hook disagrees with the body, a reference is broken, a date is relative, or two entries carry one fact and should merge.
- promote: a memory that is really a standing instruction. Name the destination using the platform reference. Promote only instructions that change future behavior and are not already covered there; use a skill for a multi-step workflow. Tool behavior alone is not a standing instruction.
- keep: earns its index line and recall cost as written.
What ships with it
3 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.
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.
- 20d ago Changed · +8 lines 6d792ff5821a
- 22d ago Changed · -1 lines 55c32862a07b
- 23d ago Changed · -4 lines f08a3fd9d8d1
- 1mo ago Changed · +1 lines 150f9df9c34d
- 2mo ago Changed · -1 lines 42c2805acddb
- 2mo ago Changed 27f54b4baf81
- 2mo ago Changed · -5 lines 98b969c688cf
- 2mo ago Changed · +2 lines · -15 tokens per session eb9f71764bf3
- 2mo ago Changed 282624b0aa0f
- 2mo 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 (144 stars, last pushed today), licensed MIT. It adds 49 tokens to every session and 778 once invoked, about $0.0002 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-05.
refactor-memory compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactor-memoryvinta/hal-9000 | Skill | 144 | today | MIT | A | 49 | Claude Code, Codex |
| rememberlangchain-ai/deepagents | Skill | 32k | today | MIT | A | 71 | Claude Code, Codex |
| mem0-climem0ai/mem0 | Skill | 70k | 3d ago | Apache-2.0 | A | 177 | Claude Code, Codex |
| mem0-vercel-ai-sdkmem0ai/mem0 | Skill | 70k | 3d ago | Apache-2.0 | A | 146 | Claude Code, Codex |
| mempalace-recallMemPalace/mempalace | Skill | 61k | today | MIT | A | 94 | Claude Code |
| mempalace-taskMemPalace/mempalace | Skill | 61k | today | MIT | A | 67 | Claude Code |
| mem0-tourmem0ai/mem0 | Skill | 70k | 3d ago | Apache-2.0 | A | 47 | Claude Code, Codex |