Skip to content

Getting Started

  • Node.js 20+
  • A CLAUDE.md file (or any markdown instruction file)
Terminal window
npm install -g @mcptoolshop/claude-rules

Or run directly with npx:

Terminal window
npx @mcptoolshop/claude-rules analyze

The analyze command scores each section and proposes extractions:

Terminal window
claude-rules analyze

You’ll see output like:

File: .claude/CLAUDE.md (258 lines, ~2388 tokens)
Keep inline (core): 4 sections
✓ (preamble) 2 lines
✓ Role 9 lines
✓ Guardian Self-Check 4 lines
✓ Document Delight 8 lines
Proposed extractions: 8 sections
1. "GitHub Actions Rules" (L92-149, 58 lines, ~330 tokens)
→ .claude/rules/github-actions.md
keywords: [github, actions, workflow, runner]
Budget estimate:
Always loaded: ~208 tokens (23 lines)
On-demand: ~2180 tokens (225 lines)
Savings: 91% per session

When you’re ready to extract, run split:

Terminal window
claude-rules split

For each proposed section, you’ll see a preview and can approve or skip. Approved sections get extracted to .claude/rules/ with frontmatter metadata.

To preview without writing anything:

Terminal window
claude-rules split --dry-run

After splitting, use validate to check health and stats to see your budget:

Terminal window
claude-rules validate
claude-rules stats

Read How It Works to understand the three-layer architecture and routing system.