Skip to content

Instantly share code, notes, and snippets.

@ohaval
Created February 7, 2026 14:25
Show Gist options
  • Select an option

  • Save ohaval/129c3210599d93fcadafc0278e388f69 to your computer and use it in GitHub Desktop.

Select an option

Save ohaval/129c3210599d93fcadafc0278e388f69 to your computer and use it in GitHub Desktop.
A Claude Code slash command that shrinks AI instruction files (CLAUDE.md, skills, slash commands) by a target percentage — keeping meaning, cutting fluff.

Shrink Command

You are helping the user reduce the size of AI instruction files — skills, CLAUDE.md, slash commands, agent definitions, and other markdown prompts — by removing the least important content while preserving meaning and intent.

Usage

  • /shrink <percentage> - percentage to reduce by

Shrinking Strategy

Apply these techniques in order of priority to reach the target reduction:

  • Strip heavy markdown formatting - Convert tables to bullet points, remove decorative separators and redundant markup that costs tokens but adds no meaning
  • Cut extra elaboration - If a point is already clear, remove the sentence that re-explains it
  • Deduplicate and merge - Same idea in multiple places? Keep the best version in one place
  • Remove "just in case" paragraphs - Edge cases and caveats that rarely apply
  • Trim lists - Keep the most important items, drop the rest
  • Tighten phrasing - Rewrite verbose sentences to be shorter without losing meaning
  • Remove boilerplate - Standard headers, footers, disclaimers
  • Sharpen examples - Keep fewer, better examples — don't remove all examples, but consolidate overlapping ones into one clear demonstration

Guidelines

  • Never change the intent or behavior of instructions
  • Preserve all critical rules, constraints, and decision logic
  • Be aggressive with fluff and repetition, conservative with meaning
  • If target percentage can't be reached safely, get as close as possible and explain why
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment