Agent skill

Refactor Memory

by vinta in vinta/hal-9000

A skill your agent uses when refactoring Claude Code or Codex memories to remove stale or derivable entries, resolve contradictions, promote standing instructions, or reorganize recall.

MITAuto-check passedAgent Workflows

Install Refactor Memory

skills CLI
$ npx skills add vinta/hal-9000 --skill refactor-memory -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vinta/hal-9000 refactor-memory --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vinta/hal-9000.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/refactor-memory .claude/skills/refactor-memory && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
refactor-memory
GitHub stars
138
Token cost
~887 tokens
SKILL.md length
443 words
Files
3 (incl. references)
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when refactoring Claude Code or Codex memories to remove stale or derivable entries, resolve contradictions, promote standing instructions, or reorganize recall.

  • Works in 6 steps: Pick the target. Use the scope or… → Read the evidence. Follow the… → Audit entries. Give every entry exactly… → …
  • Refactoring Claude Code
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Codex memories to remove stale

What it does

Refactor Memory is an agent skill from vinta/hal-9000. Use when refactoring Claude Code or Codex memories to remove stale or derivable entries, resolve contradictions, promote standing instructions, or reorganize recall. Not for standalone CLAUDE.md, AGENTS.md, or rules cleanup

Its SKILL.md is about 890 tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/claude-code.md` and `references/codex.md`).

It sits in Agent Workflows, covering Refactoring and Agent instruction files. The repository describes itself as: Opinionated AI coding agent and dev environment automation for macOS. The licence is MIT.

When your agent uses it

  • Refactoring Claude Code
  • Codex memories to remove stale
  • Derivable entries
  • Resolve contradictions

Example prompts

  • “/refactor-memory”

Requirements

  • Pre-approved tools (allowed-tools): WebFetch, Read(~/.claude/**), Edit(CLAUDE.md)

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Pick the target. Use the scope or directory the user names, otherwise the platform default below. Load the reference for the active…
  2. Read the evidence. Follow the reference's reading procedure and fetch its official memory guide. Compare entries against applicable loaded…
  3. Audit entries. Give every entry exactly one verdict, with its location and evidence beside it. Done when no entry in scope lacks one.
  4. Audit recall. Apply the platform's index or summary checks. Check discoverability, duplicate claims, scope, and evidence references…
  5. Get decisions. Reuse verdicts the user already selected within the requested scope. Present remaining contradictions with both sides as…
  6. Apply and verify. Apply the selected verdicts through the platform's update mechanism without asking again. Remove a promoted memory only…

What it can do on your machine

Read from SKILL.md and the folder at commit 0a2005a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • WebFetch
    • Read(~/.claude/**)
    • Edit(CLAUDE.md)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Refactor Memory loads about 887 tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 60 tokens; SKILL.md has 443 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~887
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vinta/hal-9000 at commit 0a2005a, republished under its MIT licence (© vinta). 443 words, ~887 tokens.

Download SKILL.mdSave it as .claude/skills/refactor-memory/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
refactor-memory
description
Use when refactoring Claude Code or Codex memories to remove stale or derivable entries, resolve contradictions, promote standing instructions, or reorganize recall. Not for standalone CLAUDE.md, AGENTS.md, or rules cleanup
allowed-tools
WebFetch, Read(~/.claude/**), Edit(CLAUDE.md)
argument-hint
[scope | path/to/memory/dir]

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

  1. 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.

  2. 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.

  3. 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.
  4. Audit recall. Apply the platform's index or summary checks. Check discoverability, duplicate claims, scope, and evidence references. Propose the layout changes needed for the entries in scope.

  5. Get decisions. Reuse verdicts the user already selected within the requested scope. Present remaining contradictions with both sides as choices and unselected delete, rewrite, and promote verdicts as numbered lists with evidence and the proposed layout. Use the platform's question tool only for unresolved choices. Apply only the outcomes the user selected.

  6. Apply and verify. Apply the selected verdicts through the platform's update mechanism without asking again. Remove a promoted memory only after its destination carries the instruction. Verify the result using the platform reference and report any pending consolidation separately from completed changes. Anything else noticed while editing is a follow-up.

© vinta, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/refactor-memory of vinta/hal-9000.

  • SKILL.md
  • references/claude-code.md
  • references/codex.md

Open the folder on GitHubat commit 0a2005a

Compare with similar skills

Refactor Memory next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Refactor Memory compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactor Memory this skillvinta/hal-9000138—~887Automated safety check: PassMIT
Docslatitude-dev/latitude-llm4.7k—~2.5kAutomated safety check: PassMIT
Steadyagent WorkflowKhalilzhang0825/boring-is-all-you-need173—~1kAutomated safety check: PassMIT
Update Docspeterkrueck/Claude-Code-Development-Kit1.4k—~2.7kAutomated safety check: PassMIT
Claude Md Writerserejaris/personal-corp-os229—~1.6kAutomated safety check: PassMIT
Refresh AgentsUniClipboard/UniClipboard1.8k—~835Automated safety check: PassAGPL-3.0

Similar skills

  • Docs

    latitude-dev/latitude-llm

    Review the current conversation context and git changes, then persist durable repository knowledge into dev-docs/.md by domain and into AGENTS.md for cross-cutting repo rules.

    4.7k GitHub stars~2.5k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Steadyagent Workflow

    Khalilzhang0825/boring-is-all-you-need

    Local-first Codex workflow for planning, debugging, reviewing, refactoring, improving AGENTS.md, building skills, publishing agent harness repositories, or running complex multi-step coding tasks…

    173 GitHub stars~1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Update Docs

    peterkrueck/Claude-Code-Development-Kit

    Update project documentation after code changes. An agent skill from peterkrueck/Claude-Code-Development-Kit.

    1.4k GitHub stars~2.7k tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed
  • Claude Md Writer

    serejaris/personal-corp-os

    A skill your agent uses when creating or refactoring CLAUDE.md files - enforces best practices for size, structure, and content organization

    229 GitHub stars~1.6k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Refresh Agents

    UniClipboard/UniClipboard

    Refresh fact-based sections of crates/AGENTS.md (STRUCTURE, WHERE TO LOOK, COMPLEXITY HOTSPOTS, KNOWN BROKEN) from current codebase state.

    1.8k GitHub stars~835 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Mcaf Solid Maintainability

    managedcode/Storage

    Apply SOLID, SRP, cohesion, composition-over-inheritance, and small-file discipline to code changes.

    138 GitHub stars~1.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from vinta/hal-9000

All 15 skills in this repo
  • Finds which plugins in the repository changed, bumps only the ones not already bumped since origin/main, and checks that each plugin's two manifests stay in sync.

    138 GitHub stars~1k tokensUpdated 2 days ago
    Auto-check passed
  • Audits your Claude Code settings and environment variables against the current official docs and returns a ranked list of changes tied to how you actually work.

    138 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • Logical Git Commits

    vinta/hal-9000

    Commits everything in the working tree as one logical change per commit, splitting files by hunk, with bodies that say what was wrong before and never an invented reason.

    138 GitHub stars~3.1k tokensUpdated 2 days ago
    Auto-check passed
  • PR

    vinta/hal-9000

    A skill your agent uses when the user explicitly asks to push the current branch and open a PR, rewrite an open PR's body from its commits, or wait for CI and merge it

    138 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • Keeps Ansible install tasks in line with upstream docs by fixing version, install-method and link drift one tool at a time, with a commit for each.

    138 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • Rewrites docs, READMEs, issues, comments or UI text in plain Global English that translates well and still sounds native, keeping every fact intact.

    138 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed

Questions about Refactor Memory

What does Refactor Memory do?

A skill your agent uses when refactoring Claude Code or Codex memories to remove stale or derivable entries, resolve contradictions, promote standing instructions, or reorganize recall. Refactor Memory is an agent skill from vinta/hal-9000. Use when refactoring Claude Code or Codex memories to remove stale or derivable entries, resolve contradictions, promote standing instructions, or reorganize recall.

When should I use Refactor Memory?

Refactor Memory fits situations like: refactoring Claude Code; Codex memories to remove stale; derivable entries; resolve contradictions.

How do I install Refactor Memory in Claude Code?

Run `npx skills add vinta/hal-9000 --skill refactor-memory -a claude-code`. Or copy the skill folder (skills/refactor-memory in vinta/hal-9000) into .claude/skills/refactor-memory in your project. Claude Code loads it when a task matches its description.

How do I install Refactor Memory in Codex?

Run `npx skills add vinta/hal-9000 --skill refactor-memory -a codex`. Or copy the skill folder (skills/refactor-memory in vinta/hal-9000) into .agents/skills/refactor-memory in your project. Codex loads it when a task matches its description.

Can I use Refactor Memory in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vinta/hal-9000 --skill refactor-memory -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refactor-memory, .gemini/skills/refactor-memory, .github/skills/refactor-memory and .opencode/skills/refactor-memory in your project.

What does Refactor Memory need to run?

SKILL.md names no scripts, command-line tools or credentials: Refactor Memory is instructions for the agent only. Its frontmatter pre-approves these tools: WebFetch, Read(~/.claude/**), Edit(CLAUDE.md).

Does Refactor Memory access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Refactor Memory safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Refactor Memory use?

Refactor Memory is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Refactor Memory use?

About 887 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.5k tokens, read only when the agent opens those files.

What are the alternatives to Refactor Memory?

Skills that share tags, products or a category with Refactor Memory: Docs (latitude-dev/latitude-llm, 4.7k stars), Steadyagent Workflow (Khalilzhang0825/boring-is-all-you-need, 173 stars), Update Docs (peterkrueck/Claude-Code-Development-Kit, 1.4k stars) and Claude Md Writer (serejaris/personal-corp-os, 229 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refactor Memory?

vinta (a GitHub user) maintains it in vinta/hal-9000, which has 138 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 5, 2026.

Source: vinta/hal-9000 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.