distill-claude-md

Compress and deduplicate instruction documents while preserving behavioral rules.

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/harivansh-afk/loom-index-e2e --skill distill-claude-md-harivansh-afk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: distill-claude-md
Source: https://github.com/harivansh-afk/loom-index-e2e/tree/main/skills/distill-claude-md
Command: npx skills add https://github.com/harivansh-afk/loom-index-e2e --skill distill-claude-md-harivansh-afk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Instruction documents like CLAUDE.md, AGENTS.md, system prompts, and rules files grow sprawling and repetitive over time, wasting context tokens and causing contradictions. This Skill rewrites them into the smallest text that still produces the same agent behavior. ## Core Features & Use Cases - Deduplication and factoring: Collapses repeated or near-duplicate rules into one source of truth and factors shared conditions across rule clusters. - Generalization with guardrails: Lifts overly specific examples into the invariant they illustrate while preserving triggers, actions, absolutes, and concrete handles like commands, paths, and flags. - Behavior validation: Verifies the compressed doc still drives the same behavior by spawning fresh claude -p sessions via the prompt-eval skill. - Use Case: A project CLAUDE.md has grown to hundreds of lines with overlapping rules. Use this Skill to merge duplicates, relocate narrow facts to their owners, and cut the doc to a fraction of its size without changing what the agent does. ## Quick Start Distill my CLAUDE.md file to remove duplication and make it as concise as possible without losing any behavioral rules.

Frequently Asked Questions about distill-claude-md

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

FAQPage Schema
How do I compress a CLAUDE.md file without losing rules?▼

Read the whole document, cluster duplicate or related claims, then rewrite each cluster to its smallest form while keeping the trigger, action, and non-obvious why of every rule. Validate afterward by testing that the behavior still emerges in fresh sessions.

How to deduplicate rules in an AGENTS.md or system prompt?▼

Group claims that state the same fact in different sections, pick the best single statement, and delete the rest. Factor shared conditions algebraically so common context is stated once and only the deltas remain.

What parts of an instruction doc should never be cut?▼

Never cut the trigger, the action, or the non-obvious why behind a rule, and never abstract away concrete handles like commands, paths, flags, or numbers. Rules stated as absolutes must stay absolute after rewriting.

How do I verify a compressed prompt still works the same?▼

Spawn fresh claude -p sessions on neutral tasks that should trigger the rewritten rules and confirm the behavior still emerges. Reading the diff alone is not sufficient proof that behavior survived.

When should facts be moved out of CLAUDE.md?▼

Move a fact out when it matters only to one file, command, or subsystem rather than applying cross-cutting. Relocate it next to its owner, such as a code comment, memory, or topic skill, so the always-loaded doc stays small.