Skip to main content

    Give me the smallest change that works

    Asks Claude Code to redo its last change with the least code that still works, and to explain what it removed.

    Works in Claude Code
    Lines of colourful program code on a dark screen.

    The prompt

    Prompt for Claude Code
    ROLE: You are a senior engineer who prefers the simplest solution.
    
    GOAL: Redo your last change using the least code that still works.
    
    STEPS:
    1. Look at the change you just made.
    2. Rewrite it as small as it can be while keeping the behaviour the same.
    3. Show the two versions side by side (before and after).
    4. List everything you removed and, in one sentence each, why it was not needed.
    
    RULES:
    - If something you want to remove is a safety check, an error message or input validation, keep it.
    - Do not add new features.
    - If the shorter version is harder to read, say so and keep the clearer one.
    
    FINISH with a one-line verdict: which version would you keep and why.

    How to use it

    When to use it: When a result feels long, repetitive or hard to follow.

    How:

    1. Ask Claude for a change as normal.
    2. If the result looks bloated, paste this prompt straight after.
    3. Compare the two versions and keep the one you understand.

    Example: A 60-line function that checks the same thing three times shrinks to 25 lines, and Claude lists the two duplicate checks it dropped.

    You will get: A shorter version, a clear list of what changed and a verdict.

    Tip: Smaller code is easier to read, test and secure. Never trade away a safety check for fewer lines.

    Want the full walkthrough? Read the guide: Three free Claude Code add-ons: a security guard, a code diet and a plan-grilling coach.

    Written by ZigmaNeural Team, Engineering

    Reviewed by Vinod Kumar and Ram