Deterministic edits with Claude, the useful 20%

For anyone who asks Claude to change one thing in a file and needs everything else left exactly as it was. Everything else is deliberately left out.
PrimerAI · Working with ClaudeOctober 13, 2026
The one confusion. "Update the file" sounds like an edit, but Claude hears "write it again". Determinism doesn't come from a setting; it comes from removing choices: forbid regenerating, lock the scope, and demand proof that nothing else moved.

The moves that matter

MoveThink of it asWhat actually happens
Name the exact targetPointing at one brick, not the wallSay the selector, slide, cell, function or sentence. "Change .card padding to 16px", never "tidy the styling".
Lock everything elseTape over the rest of the canvas"Everything else stays byte-identical: no reformatting, no improvements, no renaming."
Edit in placeA patch, not a reprintClaude changes the original file with targeted find-and-replace edits instead of rebuilding it from scratch.
Ask, don't guessStop at the fork"If anything is ambiguous, stop and ask." Guesses are where drift starts.
Demand proofShow me the receiptA diff against the original, plus a line confirming nothing outside the scope changed.

The edit contract (paste it, or keep it in a skill)

EDIT MODE: surgical, not generative.
- Change ONLY: [exact element / slide / cell / selector].
- Everything else stays byte-identical. No reformatting,
  no "improvements", no renaming.
- Edit the original file in place. Never rebuild it.
- If anything is ambiguous, stop and ask. Do not guess.
- When done: show a diff vs. the original and confirm
  nothing outside scope changed.

By file type: where each one drifts

FileAsk forWatch for
HTML / CSSTargeted replace edits and a diff; name the selector or tokenWhole-file rewrites, reformatted markup, renamed classes
PPTX / DOCXEdit the underlying XML in place; render before and after to images and compareFonts, spacing, theme colours, master layouts
XLSXList the exact cells; leave formulas alone; recalculate afterFormulas turned into values, formats, sheet order
Images / SVGCode with explicit numbers: sizes, hex colours, coordinatesRedrawn shapes; "make it pop" is a wish, numbers are a spec
Markdown / docsQuote the exact sentence or section, and the new textTidied wording elsewhere, merged sections
Code / JSONName the function or key; run the syntax check or testsRefactors you didn't ask for, reordered keys

Safe to try

None of these can damage your file. They only make drift visible before it lands.

Safe moveWhy it cannot hurt
"Show me the diff before you save"Nothing is written until you've seen exactly what changes.
Keep a copy of the originalAny edit can be undone by putting the copy back.
Render before and afterFor anything visual, side-by-side images catch what a diff can't show.
One change per requestA small diff is easy to check; ten changes at once hide the eleventh.

The everyday loop

Name the one thing, paste the contract, read the diff, accept or say "undo that part". Repeat for the next change. The checking step is what makes it trustworthy: the same request can come back slightly different twice, but a diff tells you every time.

Practice, start to finish

  1. Copy the file you'll change, so the original is safe. You now have two identical files.
  2. Ask: "Edit mode: surgical. Change only the heading colour in .title to #0d3b66. Show the diff first." Claude replies with a short diff: one line removed, one added.
  3. Read the diff. If anything else appears in it, say "only the colour; revert the rest".
  4. Tell Claude to save, then open the file. The heading is the new colour; everything else looks exactly as before.

When you make a mess

SituationWay outWhat it does
The diff shows extra changes"Revert everything except [the target]."Puts the untouched parts back exactly.
Formatting shifted across the fileRestore your copy and ask again with the contract.Starts from the clean original.
A slide or doc looks off but the text is rightRender before/after and point at the difference.Turns "something's wrong" into a specific fix.

Leave this alone: asking Claude to "clean up", "improve" or "regenerate" a file you care about. That's an invitation to rewrite everything, and it's how one-line changes become fifty.

Why the way out works. Because you kept the original and asked for a diff, every change is visible and reversible. You never have to trust the output; you check it.

Words you will see

Deterministic
Same input, same result, every time.
Diff
A list of exactly which lines changed between two versions.
Byte-identical
Not just looking the same: the file's contents are unchanged, down to spaces.
Temperature
A model setting for randomness. Not available in the claude.ai chat, and even at 0 not a guarantee.

Deliberately not here

Temperature and API settings (the chat doesn't expose them, and checking beats tuning), version control tools like git (a saved copy does the job for one file), and building your own edit tooling. Put the contract in a skill and you'll rarely need more.

Deterministic edits with Claude · two-page primer · October 13, 2026 · Rich Price