Agent skill

Refactor Claude Md

by vinta in vinta/hal-9000

A skill your agent uses when about to refactor or refine a user-level or project-level CLAUDE.md

MITAuto-check passedAgent Workflows

Install Refactor Claude Md

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

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

GitHub CLI
$ gh skill install vinta/hal-9000 refactor-claude-md --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-claude-md .claude/skills/refactor-claude-md && 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-claude-md
GitHub stars
138
Token cost
~1.8k tokens
SKILL.md length
1,034 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when about to refactor or refine a user-level or project-level CLAUDE.md

  • Works in 5 steps: Pick the target. If the invocation names… → Fetch the guides. Fetch these pages.… → Audit. Read the file and give every… → …
  • About to refactor
  • Reaches platform.claude.com
  • Refine a user-level

What it does

Refactor Claude Md is an agent skill from vinta/hal-9000. Use when about to refactor or refine a user-level or project-level CLAUDE.md

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

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

When your agent uses it

  • About to refactor
  • Refine a user-level
  • Project-level CLAUDE.md

Example prompts

  • “/refactor-claude-md”

Requirements

  • Pre-approved tools (allowed-tools): WebFetch(domain:platform.claude.com), WebFetch(domain:code.claude.com), Edit(CLAUDE.md), Read(~/.claude/CLAUDE.md)

Workflow steps

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

  1. Pick the target. If the invocation names one, use it. Otherwise ask with AskUserQuestion, one option per file that exists, with the…
  2. Fetch the guides. Fetch these pages. They calibrate the delete and rewrite verdicts below
  3. Audit. Read the file and give every instruction exactly one verdict, judged against the target's bar below. Done when no instruction lacks…
  4. Get decisions. One AskUserQuestion per contradiction, with each conflicting version as an option. Then present the delete and demote…
  5. Rewrite. Apply the signed-off verdicts in one pass, without asking again; they are the request. Apply only those: anything else noticed…

What it can do on your machine

Read from SKILL.md and the folder at commit 46dc048. 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(domain:platform.claude.com)
    • WebFetch(domain:code.claude.com)
    • Edit(CLAUDE.md)
    • Read(~/.claude/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

    Hosts in commands or code, which the agent is likely to contact:

    • platform.claude.com

    Also links to:

    • code.claude.com

    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 Claude Md loads about 1.8k tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 1,034 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

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 46dc048, republished under its MIT licence (© vinta). 1,034 words, ~1,828 tokens.

Download SKILL.mdSave it as .claude/skills/refactor-claude-md/SKILL.md (or your agent's skills folder).
name
refactor-claude-md
description
Use when about to refactor or refine a user-level or project-level CLAUDE.md
allowed-tools
WebFetch(domain:platform.claude.com), WebFetch(domain:code.claude.com), Edit(CLAUDE.md), Read(~/.claude/CLAUDE.md)
argument-hint
user | project | path/to/CLAUDE.md

Overview

Refactor a CLAUDE.md. Every line it keeps is loaded into every session the file covers, and a frontier model follows only around 150 to 200 standing instructions consistently, so each line competes for that budget. Everything else moves down the ladder or out of the file.

The file serves every model the user runs, not only the one this session runs on, so audit it against every model the user runs. Claude Code assembles its system prompt per model: a line that merely restates the prompt under one model can be the only copy under another.

Instructions

  1. Pick the target. If the invocation names one, use it. Otherwise ask with AskUserQuestion, one option per file that exists, with the resolved path in the label:

    • The user-level CLAUDE.md at ~/.claude/CLAUDE.md.
    • The current project's CLAUDE.md.

    Then settle the models to audit: the ones the invocation names, otherwise ask in the same question call, multi-select, with this session's model as the first option. Resolve each to its full model ID from the model list in your system prompt.

  2. Fetch the guides. Fetch these pages. They calibrate the delete and rewrite verdicts below:

  3. Audit. Read the file and give every instruction exactly one verdict, judged against the target's bar below. Done when no instruction lacks one.

    • contradiction: conflicts with another instruction, or the model pages pull it opposite ways: one says to remove it while another model still needs it, or no single wording satisfies every page. Record both sides.
    • delete: fails the no-op test on every audited model, meaning each would behave the same without it, or a model page says to remove it because it was written for an earlier model's habits and no other audited model needs it either. Judge defaults against the fetched pages and the probe below, not memory. Covers instructions the models already follow by default, instructions too vague to act on, and platitudes like "write clean code". A line any audited model needs is a keep.
    • demote: real instruction that only applies to some paths or tasks. Pick its destination from the bar. If it describes a multi-step workflow, propose a skill instead. Name the destination in the sign-off.
    • rewrite: right meaning, phrasing falls short of the fetched best practices. Also a rewrite when the line carries words that fail the no-op test on their own: a duplicate of another line, a definition of a term the model knows, or emphasis; a rationale or example stays, since both steer the model. Where a model page gives measured wording for the same instruction and every other model's page allows it, use that wording. Voice follows the system prompt: a line addresses the model as "you" and names the human as "the user", so "I" or "my" for the human, and "Claude" or "the agent" for the model, are rewrites; words quoted as user speech keep their own voice.
    • keep: earns its always-loaded cost as written.

    A delete that rests on the shipped system prompt already saying the same thing needs evidence from every audited model, because the prompt differs per model. Ask each model, the session's own one included, to quote the sentence of its prompt that carries the line. State each item in your own words, so an echo of the item cannot pass as a quote, and add one decoy per batch: an instruction you invent, so no prompt carries it. Pass --safe-mode so the answer reflects the shipped prompt alone, since print mode otherwise loads CLAUDE.md files, plugins, and output styles too; --no-session-persistence --max-turns 1 keep the probe from leaving a transcript or running tools; and always pass --model <model-id> since print mode otherwise inherits the settings.json default:

    text
    claude -p --safe-mode --no-session-persistence --max-turns 1 --model <model-id> --output-format text 'For each item, quote verbatim the sentence from your system prompt that carries the same instruction, or write NONE. One line per item, "<n>: <quote>" or "<n>: NONE", nothing else. 1: <the instruction in your own words> 2: <decoy>'

    Then verify, in this order. The decoy must come back NONE on every model. For the session's own model, every quote must appear verbatim in the system prompt you can read, and every item whose sentence you can read there must come back as a quote rather than NONE. Either failing means the method is broken for this run and no prompt-dependent delete is safe. For each other model, a quote you find verbatim in your own prompt covers the line there. A quote you cannot find is a different wording: ask that model Answer "PRESENT" or "ABSENT", nothing else. Is this exact phrase present anywhere in your system prompt? "<quote>", and only PRESENT covers the line. NONE, a quote that repeats the item, or a failed check leaves the line uncovered under that model. A quote covers the line only when the quoted sentence makes it a no-op, not when it shares the topic. Tool descriptions cannot be probed this way, because print mode loads fewer tools and AskUserQuestion is not among them; treat tool JSON as identical across models. A line the prompt leaves uncovered under any audited model is a keep.

    The bar per target:

    • User-level (loaded into every session in every project): a keep must apply across all projects. Demote destination: a paths:-scoped file in ~/.claude/rules/.
    • Project-level (loaded into every session in this project): a keep must be underivable from the code: a one-sentence project description, commands the agent would guess wrong, domain concepts, gotchas. Lines restating what the code already shows, and volatile detail like file trees, are deletes because they go stale and stale lines poison the context. Demote destinations: a paths:-scoped file in .claude/rules/, or a doc file linked from CLAUDE.md.
  4. Get decisions. One AskUserQuestion per contradiction, with each conflicting version as an option. Then present the delete and demote lists, with the per-model probe result beside each prompt-dependent delete, and collect sign-off with one AskUserQuestion. The file stays untouched until sign-off.

  5. Rewrite. Apply the signed-off verdicts in one pass, without asking again; they are the request. Apply only those: anything else noticed while editing is a follow-up to report in the final message. When creating a new rules file, fetch https://code.claude.com/docs/en/memory#path-specific-rules for the paths: frontmatter syntax. Done when every audited instruction landed where its verdict says: kept, rewritten, demoted, or deleted.

© 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

Just SKILL.md in skills/refactor-claude-md of vinta/hal-9000.

Open the folder on GitHubat commit 46dc048

Compare with similar skills

Refactor Claude Md 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 Claude Md compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactor Claude Md this skillvinta/hal-9000138—~1.8kAutomated safety check: PassMIT
Docslatitude-dev/latitude-llm4.7k—~2.5kAutomated safety check: PassMIT
Agent Md Refactormicronaut-projects/micronaut-openapi114—~766Automated safety check: PassApache-2.0
Steadyagent WorkflowKhalilzhang0825/boring-is-all-you-need173—~1kAutomated safety check: PassMIT
Reclaudebrianlovin/agent-config3771 repos~981Automated safety check: PassNone
Agent Md Refactormeshery/meshery-operator1515 repos~1.9kAutomated safety check: PassMIT

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 today
    Agent WorkflowsAuto-check passed
  • Agent Md Refactor

    micronaut-projects/micronaut-openapi

    Refactor oversized agent instruction files into a progressive-disclosure structure.

    114 GitHub stars~766 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 2 mo ago
    Agent WorkflowsAuto-check passed
  • Reclaude

    brianlovin/agent-config

    Refactor CLAUDE.md files to follow progressive disclosure principles.

    377 GitHub starsUsed in 1 repo~981 tokens
    Agent WorkflowsAuto-check passed
  • Agent Md Refactor

    meshery/meshery-operator

    Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles.

    151 GitHub starsUsed in 5 repos~1.9k tokens
    Agent WorkflowsAuto-check passed
  • Agents Md Mapper

    alchemiststudiosDOTai/harness-engineering

    This skill should be used when creating, refreshing, or validating a repository AGENTS.md so it stays concise, current, and grounded in repository evidence.

    105 GitHub stars~1.8k tokensUpdated 6 mo ago
    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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    Auto-check passed

Categories

Questions about Refactor Claude Md

What does Refactor Claude Md do?

A skill your agent uses when about to refactor or refine a user-level or project-level CLAUDE.md. Refactor Claude Md is an agent skill from vinta/hal-9000.

When should I use Refactor Claude Md?

Refactor Claude Md fits situations like: about to refactor; refine a user-level; project-level CLAUDE.md.

How do I install Refactor Claude Md in Claude Code?

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

How do I install Refactor Claude Md in Codex?

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

Can I use Refactor Claude Md 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-claude-md -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-claude-md, .gemini/skills/refactor-claude-md, .github/skills/refactor-claude-md and .opencode/skills/refactor-claude-md in your project.

What does Refactor Claude Md need to run?

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

Does Refactor Claude Md access the network?

SKILL.md names 2 domains. In commands or code: platform.claude.com; the agent is likely to contact it when it follows the instructions. As links in the text: code.claude.com. This is read from the text; nothing was executed.

Is Refactor Claude Md 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 Claude Md use?

Refactor Claude Md 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 Claude Md use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Refactor Claude Md?

Skills that share tags, products or a category with Refactor Claude Md: Docs (latitude-dev/latitude-llm, 4.7k stars), Agent Md Refactor (micronaut-projects/micronaut-openapi, 114 stars), Steadyagent Workflow (Khalilzhang0825/boring-is-all-you-need, 173 stars) and Reclaude (brianlovin/agent-config, 377 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refactor Claude Md?

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 8, 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.