claude-md-compact

Reduce CLAUDE.md word count by removing redundant rules and migrating context-specific directives to AGENTS.md or SKILL.md files.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/NicoVIII/claude-config --skill claude-md-compact
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-md-compact
Source: https://github.com/NicoVIII/claude-config/tree/main/skills/claude-md-compact
Command: npx skills add https://github.com/NicoVIII/claude-config --skill claude-md-compact

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the issue of configuration bloat where CLAUDE.md becomes overly long, increasing token costs and reducing the effectiveness of global preferences.

Core Features & Use Cases

  • Rule Consolidation: Identifies redundant rules that are already covered by other instructions or logic.
  • Strategic Migration: Safely moves repo-specific rules into dedicated AGENTS.md or SKILL.md files to ensure they only load when necessary.
  • Use Case: When you notice that your global preferences are too long or you are hitting token limits, use this skill to prune unnecessary rules and reorganize your configuration for better performance.

Quick Start

Run the claude-md-compact skill to analyze your current CLAUDE.md and propose a set of rules to remove or migrate.

Frequently Asked Questions about claude-md-compact

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

FAQPage Schema
How do I reduce token usage when my CLAUDE.md configuration file is too long?

Reduce CLAUDE.md token usage by identifying redundant instructions and migrating context-specific directives to localized AGENTS.md or SKILL.md files, ensuring they load only when necessary.

What is the best way to organize global preferences versus repo-specific rules in Claude Code?

The best way to organize global preferences is keeping broad rules in CLAUDE.md while strategically migrating repo-specific rules into dedicated AGENTS.md or SKILL.md files, preventing configuration bloat and maintaining rule effectiveness.

Do I need git version control to compact and refactor a CLAUDE.md file?

Yes, git-based version control is required to track compaction history and validate rule removal through commit logs when refactoring your CLAUDE.md configuration.

How does migrating rules to AGENTS.md or SKILL.md improve configuration performance?

Migrating rules to AGENTS.md or SKILL.md improves configuration performance by ensuring context-specific directives load only when necessary, which reduces global token costs and increases the effectiveness of remaining CLAUDE.md preferences.

When should I avoid removing rules during a CLAUDE.md refactoring?

You should avoid removing rules during CLAUDE.md refactoring when those instructions have dependencies with other active logic, unless you safely migrate them to localized AGENTS.md or SKILL.md files to preserve their required context.

Why does my global CLAUDE.md configuration reduce the effectiveness of my instructions?

Your global CLAUDE.md configuration reduces effectiveness when configuration bloat from overly long files increases token costs and dilutes the impact of global preferences, making it harder for the model to prioritize critical rules.