meta-consolidate-claude-md

Detects, verifies, and consolidates duplicated sections across CLAUDE.md files in a directory tree.

1|Updated Jun 23, 2026
One-click install
npx skills add https://github.com/bitranox/bitranox-skills --skill meta-consolidate-claude-md-bitranox
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: meta-consolidate-claude-md
Source: https://github.com/bitranox/bitranox-skills/tree/main/plugins/bitranox/skills/meta-consolidate-claude-md
Command: npx skills add https://github.com/bitranox/bitranox-skills --skill meta-consolidate-claude-md-bitranox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Copy-pasted guidance across many CLAUDE.md files drifts over time, so duplicated sections become a correctness problem: some copies describe tools that changed, files that were deleted, or targets that never existed. This Skill provides a disciplined measure-verify-converge-lift procedure to deduplicate that content without promoting false claims to ancestor files. ## Core Features & Use Cases - Duplication Measurement: Ships scripts/claudemd_variance.py, which walks a tree (never grep, so gitignored files are found), splits every CLAUDE.md into sections, hashes whitespace-normalised bodies, groups identical variants, and computes each group's true common ancestor. - Verification Before Convergence: Prescribes checking every claim against ground truth (files, commands, skills, mechanisms) before keeping it, and composing canonical text from verified lines rather than picking the most-copied variant. - Safe Lifting Rules: Guards against double headings, per-file reachability checks, and loss of repo-specific rows when lifting a section to a common ancestor. - Use Case: A monorepo has the same workflow section pasted into 20 project CLAUDE.md files with three drifted variants; run the variance script, verify each claim, converge to one correct text, and lift it to the shared ancestor. ## Quick Start Run uv run scripts/claudemd_variance.py --root ~/src --json to measure duplicated CLAUDE.md sections, then follow the verify, converge, and lift steps to consolidate them.

Frequently Asked Questions about meta-consolidate-claude-md

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find duplicated sections across many CLAUDE.md files?▼

Run scripts/claudemd_variance.py with --root pointing at your tree. It splits every CLAUDE.md into level-2 sections, hashes whitespace-normalised bodies, groups identical variants, and reports each group's common ancestor and largest variant share.

Why does the tool use a filesystem walk instead of grep?▼

Session grep tools are gitignore-aware and silently skip ignored files; on one measured tree grep found 17 files where a walk found 73. The script never shells out, so it structurally cannot inherit that blind spot.

Should I lift the most-copied variant of a duplicated section?▼

No. The most-copied variant is usually the oldest, not the most correct. Verify each claim against the actual system first, then compose canonical text from verified lines before lifting anything to an ancestor.

When should duplicated CLAUDE.md content not be consolidated?▼

Do not lift sections that embed the package or repo name, copies that share only a closing pointer sentence over unique bodies, or sections where every copy is unique. Also avoid lifting narrow rules into tiers where they are irrelevant.

What whitespace differences does the section hashing ignore?▼

Normalisation converts CRLF/CR to LF, strips trailing whitespace per line, collapses runs of blank lines to one, and trims blank lines at body edges. Leading indentation is deliberately preserved because it carries structural meaning.

What are the limitations of the claudemd_variance script?▼

It does not follow symlinked directories, skips .git and other VCS directories, stops after a configurable --max-files bound (default 20000), and skips files that fail UTF-8 decoding with a warning rather than crashing.