用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vinta/hal-9000 --skill refactor-claude-md命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Use when about to choose, configure, or refine a tool, library, config format, API pattern, or project setup, or before proposing a design of your own — research current guidance, pitfalls, and prior art first; already knowing an approach, or assuming no prior art exists, is not an exemption. Also use when the user asks about best practices, gotchas, or recommended patterns
Use when about to refactor or refine a user-level or project-level AGENTS.md
Use when about to refactor or refine an existing skill, its SKILL.md or sibling files, from a full restructure down to a one-line wording fix; a change that looks too small to need this skill is not an exemption. Not for creating a skill from scratch or for fixing only its allowed-tools
| name | refactor-claude-md |
| description | Use when about to refactor or refine a user-level or project-level CLAUDE.md |
| argument-hint | ["user | project | path/to/CLAUDE.md"] |
| user-invocable | true |
| allowed-tools | ["WebFetch","Bash(claude -p *)","Edit(~/.claude/CLAUDE.md)","Edit(~/.claude/rules/**)","Edit(CLAUDE.md)","Edit(.claude/rules/**)","Write(.claude/rules/**)","Write(~/.claude/rules/**)"] |
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 both Claude Fable 5.1 and Claude Opus 5. Claude Code assembles its system prompt per model: a line that merely restates the prompt under one model can be the only copy under the other.
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:
~/.claude/CLAUDE.mdFetch the yardsticks. Fetch these pages. They calibrate the delete and rewrite verdicts below:
Audit. Read the file and give every instruction exactly one verdict, judged against the target's bar below. Done when no instruction lacks one.
A delete that rests on the shipped system prompt already saying the same thing needs evidence from both models, 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 (claude-fable-5-1, claude-opus-5) since print mode otherwise inherits the settings.json default:
claude -p --safe-mode --no-session-persistence --max-turns 1 --model claude-opus-5 --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 both models. 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 the 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 , 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 is not among them; treat tool JSON as identical across models. A line the prompt covers under only one model is a keep.
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.
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.
Answer "PRESENT" or "ABSENT", nothing else. Is this exact phrase present anywhere in your system prompt? "<quote>"AskUserQuestionThe bar per target:
paths:-scoped file in ~/.claude/rules/.paths:-scoped file in .claude/rules/, or a doc file linked from CLAUDE.md.