
Claude md refactor
Trims a repo's CLAUDE.md into a lean index with topic docs under /docs
Claude md refactor is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 5
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Claude md refactor
This skill helps an agent audit an oversized CLAUDE.md, bootstrap one for a repository that has none, or confirm that a short file is already healthy and should be left alone. The core idea is progressive disclosure: hard rules and tooling identity stay in the root file, while procedural playbooks and pattern explanations move into separate files under /docs that are read only when relevant.
When auditing, the agent reads the file end to end, classifies each block as keep, extract or drop, and shows a plan before writing anything. When bootstrapping, it explores the repository's manifests, layout and tests, proposes which topic docs to create, and checks that any referenced class, command or file actually exists before documenting it. Convention docs must describe design rules backed by real examples rather than style nits.
The skill expects a repository with a CLAUDE.md or enough code to bootstrap one, and it works with the user's own wording when extracting existing prose. It ships a template file for the root index and does not run scripts.
When your agent uses it
Refactor, audit, or bootstrap a repository's CLAUDE.md so it stays lean and acts as an index of pointers to /docs/ files instead of bloating session context. Use this skill whenever the user mentions their CLAUDE.md being too long, bloated, eating context, "collapsing context", needing cleanup, or asks to set up / audit / split / restructure / generate a CLAUDE.md, even if they don't use the word "skill" or "refactor" — also use it when the user wants project memory or AGENTS.md style instructions organized for both humans and agents.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 2 files (11 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add vpaivag/skills
/plugin install skills@vpaivagOr copy only this skill to ~/.claude/skills/claude-md-refactor:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/vpaivag/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/claude-md-refactor &&
cp -R "$tmp/skills/claude-md-refactor" ~/.claude/skills/claude-md-refactor &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/claude-md-refactor inside it instead.
Copy the skill folder to ~/.agents/skills/claude-md-refactor to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/vpaivag/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/claude-md-refactor &&
cp -R "$tmp/skills/claude-md-refactor" ~/.agents/skills/claude-md-refactor &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/claude-md-refactor inside it instead.
Copy the skill folder to ~/.cursor/skills/claude-md-refactor to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/vpaivag/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/claude-md-refactor &&
cp -R "$tmp/skills/claude-md-refactor" ~/.cursor/skills/claude-md-refactor &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/claude-md-refactor inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/vpaivag/skills.git --path skills/claude-md-refactorOr copy the folder to ~/.gemini/skills/claude-md-refactor yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/claude-md-refactor:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/vpaivag/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/claude-md-refactor &&
cp -R "$tmp/skills/claude-md-refactor" ~/.copilot/skills/claude-md-refactor &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/claude-md-refactor inside it instead.
Get the folder:
git clone --depth 1 https://github.com/vpaivag/skills.gitThen copy skills/skills/claude-md-refactor into your agent's skills folder as claude-md-refactor. Agents that support SKILL.md read one folder per skill.
What it does
- Audit and split
- Classifies each section of an existing CLAUDE.md as keep, extract or drop before moving content.
- Bootstrap from code
- Explores manifests, layout and tests to propose topic docs for a repo with no CLAUDE.md.
- Pointer-based index
- Rewrites the root file as a short list of hard rules and links to docs.
- Verify before documenting
- Confirms that referenced symbols and paths exist before writing about them.
- Healthy file check
- Recognises a lean CLAUDE.md and avoids over-editing it.
- Convention doc rules
- Guides writing design rules for code conventions with real examples.
Good for
- Shrink a bloated CLAUDE.md that is eating session context
- Set up a CLAUDE.md and docs folder for a new repository
- Split deployment or testing playbooks out of the root memory file
- Check whether an existing CLAUDE.md needs any changes at all
Claude md refactor FAQ
When does Claude md refactor trigger?
When the user mentions a CLAUDE.md being too long, bloated, eating context, needing cleanup, or asks to set up, audit, split or restructure one, including AGENTS.md style instructions.
Will Claude md refactor rewrite my existing instructions?
When extracting, it aims to preserve the user's own wording and lightly clean formatting. It asks before removing @import lines or tool-specific syntax.
Does Claude md refactor change files without asking?
In interactive use it shows a classification or file plan and waits for confirmation. In a non-interactive run it writes the plan to plan.md and proceeds.
How do I install Claude md refactor in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/claude-md-refactor to use it in all your projects, or to .claude/skills/claude-md-refactor in one project. Or install the skills plugin, which includes it: /plugin marketplace add vpaivag/skills, then /plugin install skills@vpaivag.
Does Claude md refactor run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Claude md refactor?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Claude md refactor?
The closest alternatives to Claude md refactor are Codebase onboarding, Project retrofit, Setup matt pocock skills, Agents md and Agents md improver.
Where this comes from
- Description: from the skill's own SKILL.md.
More from vpaivag/skills

Stress-tests a code diff with blind reviewer subagents that hunt for real bugs
- Open source
- 5 GitHub stars
- Developer tools

Turns a coding task into a reviewed, executable plan suite before any code is written
- Open source
- 5 GitHub stars
- Developer tools

Checks a PR or diff against the request it was meant to deliver, item by item
- Open source
- 5 GitHub stars
- Developer tools

Drafts standalone Linear issues and sub-issues that a dev or coding agent can pick up
- Open source
- 5 GitHub stars
- Productivity

Walks a newcomer through an unfamiliar codebase and sets a practice task
- Open source
- 5 GitHub stars
- Developer tools

Drafts a Linear project from related features, with milestones and issue handoff
- Open source
- 5 GitHub stars
- Productivity





