Three safe prompt cuts can still break your client's agent
Removing blocks from a system prompt and rerunning the evals is easy; the harder skill is knowing when a steady score is misleading you.
In brief
- Run the evals twice on the original prompt before changing a word, so you have a baseline and know how much the score moves on its own.
- Remove one block at a time and inspect each case; an unchanged score is trustworthy only if some case tests that block's behavior.
- Run the joint removal before deleting anything; if it breaks, add back only the smallest instruction that fixes the failure.
Anthropic removed more than 80% of Claude Code’s system prompt for models such as Claude Opus 5 and Claude Fable 5. On its own coding evals, it measured no loss.
That figure makes it tempting to start deleting. But it describes one product, on certain models, under one group of evals; your client’s prompt may contain the one line that stops an agent from issuing refunds on its own. The skill to learn is how to find that line.
OpenAI’s guidance for GPT-5.6 Sol sets out a short procedure: remove one group of instructions, examples or tools at a time, then rerun exactly the same eval set.
This guide turns that procedure into a folder you can run on a laptop. You need Python 3, access to the model the client uses, a copy of the system prompt and a set of real failures with personal data removed.
Step 1: Split the prompt by behavior
The running example is a hypothetical customer service agent. It answers common questions and prints HANDOFF_TO_HUMAN when a case should go to a member of staff. All figures about this agent are illustrative.
ablate/
blocks/
01_role.md # role and output format
02_refund.md # refund rules
03_verify.md # "check your answer before sending"
04_edge_cases.md # patches added after each incident
05_tone.md # tone of voice
06_examples.md # sample conversations
cases.jsonl
model.py
ablate.py
compare.py
As you split, read for contradictions. When Anthropic reviewed transcripts of its employees using Claude Code, it found requests that both asked for documentation to be left where appropriate and forbade adding comments. When you meet such a pair, put the two sentences in separate blocks so each can be tested on its own.
The order of testing should have a rationale too. Anthropic discourages stuffing prompts with long lists of edge cases, so 04_edge_cases is an early candidate. So is 03_verify if the client runs Claude Opus 5: that model’s documentation says self-check instructions cause excess verification, and that removing them saves tokens without reducing quality.
Check: join the files in name order and you should get the full original prompt back, with no sentence missing. Whitespace between blocks may differ, so run the baseline on the joined version.
Step 2: Write test cases for both directions
Anthropic considers 20 to 50 simple tasks drawn from real failures a good starting point. It also advises testing both when a behavior should occur and when it should not. This example uses 24 cases: 12 that must be handed to a human and 12 that must not.
{"id":"r01","input":"Order 4411 arrived with items missing, I need a refund.","must":["HANDOFF_TO_HUMAN"],"must_not":[]}
{"id":"r02","input":"What time does the store open?","must":[],"must_not":["HANDOFF_TO_HUMAN"]}
Each case sits on one line of cases.jsonl. Before calling a real model, test the grader with a fake one that always hands off:
# model.py: fake version for checking the grader
def call_model(system: str, user: str) -> str:
return "HANDOFF_TO_HUMAN"
With three trials per case, there are 72 in total. The fake model should score exactly 36/72, getting every handoff case right and every other case wrong. If the set contained only handoff cases, this useless model would earn a perfect score.
Step 3: Measure the baseline twice
The script below is a simplified version. It grades by string matching, which is enough for a handoff decision but too crude to judge tone. It does not yet handle network errors or rate limits.
# ablate.py
import json, sys
from pathlib import Path
from model import call_model
TRIALS = 3
if len(sys.argv) < 2:
sys.exit("Usage: python3 ablate.py RUN_NAME [BLOCK ...]")
name, removed = sys.argv[1], set(sys.argv[2:])
blocks = {p.stem: p.read_text(encoding="utf-8")
for p in sorted(Path("blocks").glob("*.md"))}
cases = [json.loads(line) for line in
Path("cases.jsonl").read_text(encoding="utf-8").splitlines()
if line.strip()]
unknown = removed - set(blocks)
if unknown:
sys.exit(f"Unknown blocks: {sorted(unknown)}")
def passed(case, output):
return (all(s in output for s in case["must"])
and not any(s in output for s in case["must_not"]))
system = "\n\n".join(text for key, text in blocks.items()
if key not in removed)
result = {}
for case in cases:
result[case["id"]] = sum(
passed(case, call_model(system, case["input"]))
for _ in range(TRIALS))
Path("runs").mkdir(exist_ok=True)
Path(f"runs/{name}.json").write_text(json.dumps(result, indent=2))
print(name, f"{sum(result.values())}/{len(cases) * TRIALS}",
f"{len(system)} chars")
Run it with the fake model first and confirm 36/72. Then replace the body of call_model with a call through the client’s SDK, keep the model and every parameter fixed between runs, and run the same test twice:
python3 ablate.py baseline_1
python3 ablate.py baseline_2
Taking a baseline before editing the prompt is also the sequence OpenAI recommends when migrating models. Multiple trials are needed because output varies between runs; Anthropic, too, runs several trials per task.
Check: suppose the two runs score 66/72 and 64/72. The score has moved by two trials with no change to the prompt, so a gap of that size tells you nothing yet. And 72 trials still cover only 24 situations, because trials of the same case are not independent evidence.
Step 4: Remove each block, then look at each case
python3 ablate.py no_refund 02_refund
python3 ablate.py no_verify 03_verify
python3 ablate.py no_edge 04_edge_cases
python3 ablate.py no_examples 06_examples
The total alone can hide gains that offset losses: refund questions fail three more trials, opening-hours questions pass three more, and the sum stays the same. A second script therefore compares results case by case:
# compare.py
import json, sys
from pathlib import Path
if len(sys.argv) != 3:
sys.exit("Usage: python3 compare.py BEFORE.json AFTER.json")
before, after = (json.loads(Path(p).read_text()) for p in sys.argv[1:])
for key in before:
if before[key] != after[key]:
print(key, before[key], "->", after[key])
python3 compare.py runs/baseline_1.json runs/baseline_2.json
python3 compare.py runs/baseline_1.json runs/no_refund.json
The script prints only the cases that changed. In the example, the first command returns two lines, while the second begins as follows:
# baseline_1 vs baseline_2
r05 3 -> 2
r17 2 -> 1
# baseline_1 vs no_refund (excerpt)
r01 3 -> 0
r03 3 -> 0
r05 3 -> 2
r07 3 -> 1
With the prompt unchanged, no case moved by more than one trial, so here a case that loses two or more of its three trials counts as a clear drop. r05, which lost one, does not count; r01, r03 and r07 do. This is a working threshold drawn from this particular baseline. If yours contains a case that moves by two trials, raise TRIALS and measure again from the start.
The decision follows from there. If any case drops clearly, rerun that version under a new name; if the case drops again, keep the block. If no case drops clearly but several cases testing the same behavior each lose one trial, rerun as well before calling the block a candidate for deletion.
| Run | Illustrative score | Cases with a clear drop | Decision |
|---|---|---|---|
| Baseline | 66 and 64 | 0 | Reference point |
| Without refund rules | 49 | 6 | Keep |
| Without self-check | 65 | 0 | Deletion candidate |
| Without edge cases | 64 | 0 | Deletion candidate |
| Without sample conversations | 65 | 0 | Deletion candidate |
Do not treat every decline alike. The README for konomi-ablate, an open-source tool, warns that losing one point out of 20 items after removing a sentence says nothing.
A credible fall looks very different. In an arXiv study that ran the reverse test, adding generic rules to the user prompt took Qwen 2.5 from 26/30 down to 9/30.
Two blocks have not been removed. 01_role specifies the output string the grader looks for, while 05_tone is invisible to the grader. If you dropped 05_tone and the score held, you would have learned where the test is lacking, but would still know nothing about whether the tone had survived.
Step 5: Three safe removals can still fail together
Removing blocks one by one has a blind spot, and konomi-ablate says so plainly: overlapping sentences can cover for each other. The tool confirms that a group of sentences can be deleted only after running a version with all of them removed at once.
python3 ablate.py joint 03_verify 04_edge_cases 06_examples
python3 compare.py runs/baseline_1.json runs/joint.json
In the example, the joint version falls to 52/72. Four missing-item cases drop from 3/3 to 0/3, costing 12 trials; the other two trials lost against the first baseline are within the variation already seen. The edge cases and the sample conversations taught the same rule, so when either was removed alone, the other filled in.
Do not restore both blocks. OpenAI advises adding only the smallest instruction aimed at the measured failure. Here that is a new file, blocks/07_missing_item.md:
Order with missing items: print HANDOFF_TO_HUMAN.
From this point, ablate.py loads the new file on every run. Preserve the baseline_1.json and baseline_2.json measured before it was added; rerunning the old commands would overwrite the baseline with results from a different prompt. If you need to measure the original prompt again, use a new name and remove this block: python3 ablate.py baseline_3 07_missing_item.
python3 ablate.py joint_fix 03_verify 04_edge_cases 06_examples
python3 compare.py runs/baseline_1.json runs/joint_fix.json
Check: the four failed cases should recover, and no other case should lose two or more trials. Then try several cases never used while editing the prompt, in case the new sentence merely fits the old test. The full round takes eight runs, or 576 model calls before counting new cases and reruns, so estimate the cost before you start.
Three easy mistakes
The first mistake is editing test cases midway: once a case changes, the old baseline is void and you must start over. The next is changing the model at the same time as the prompt, which leaves you unable to tell what caused a change.
The most serious is deleting a rule about access or money because a small test set failed to catch its absence. Such rules need controls outside the prompt, and any removal needs the agreement of the business owner.
What do you bring to the client meeting?
A good time to do this work is ahead of a model migration. Claude Fable 5’s documentation warns that skills written for older models are often too prescriptive and can reduce quality. Bring the meeting a table of blocks, results and decisions, and keep the old prompt intact so you can roll back if needed.
That table also belongs in your portfolio if you are looking for an FDE job. Recreate the experiment on a public prompt and keep the failed joint run, because that is where readers can see how you reason.
The resume line then nearly writes itself: the number of cases, the number of trials, how much of the prompt was removed and which regressions you caught. Put it at the top for job descriptions that mention evals, model migration or running agents in production.
Clients and interviewers will eventually ask the same question: what made you confident enough to delete this line? Let the files in runs/ answer.
Was this article useful?
Thanks for the feedback!
8 sources
- Prompting guidance for GPT-5.6 Sol
- The new rules of context engineering for Claude 5 generation models · July 24, 2026
- Effective context engineering for AI agents · Sep 29, 2025
- Prompting Claude Opus 5
- Prompting Claude Fable 5
- Demystifying evals for AI agents · January 9, 2026
- sjgant80-hub/konomi-ablate: Leave-one-out ablation for system prompts
- When Generic Prompt Improvements Hurt: Evaluation-Driven Iteration for LLM Applications · 09 Jun 2026