Delete Your CLAUDE.md After a Model Upgrade. Hook the Safety Rules First.
Delete CLAUDE.md after a model upgrade, but in a clinical repo move every domain rule into a hook, lint rule or test first. Then measure what you cut.
Key takeaways
- Before deleting CLAUDE.md, sort every line into model crutch, team convention or domain rule, and give each domain rule an owner and a source link.
- Prose that asks the model to remember a rule is a guideline it may skip; turn each domain rule into a hook, lint rule, fixture or contract test first.
- Replay past tasks with full, stripped and add-back configs on every model upgrade, and add back only lines whose removal caused a measured failure.
Delete your CLAUDE.md after a model upgrade. Most of it was written to correct a model you no longer run. In a clinical repo, do one thing first. Move every rule that protects a patient out of prose and into a hook, a lint rule or a test. A missing crutch shows up as a failed task. A missing domain rule usually shows up as nothing at all.
I learned the difference between a rule and a control on MedScrub, on the product side. We had guardrails written into the skill configs. Every claim had to cite the chart data it came from, and nothing went to the EHR without physician review. Then we found they weren't enforced on the main write path. A rule that only exists in a config file is a slide, not a control. We moved both into code. A claim with no citation now blocks the write, and the review checkbox resets on every run. I wrote that up in the FDA CDS guidance piece.
CLAUDE.md has the same problem. A clinical repo's CLAUDE.md and skills tend to hold two kinds of lines that look identical on the page. Some are crutches for weaker models: "read the file before editing", "don't stub functions". Others are domain rules: filter entered-in-error resources, never request system/ scopes, keep the OBX unit next to its value, never build a CDS card from prefetch data that isn't there. Both are one line of Markdown. Only the second kind guards a chart. The delete-it-all advice treats them the same.
What the "delete your CLAUDE.md" advice says
Here is Boris Cherny's line from his YC talk, as AY Automate transcribed it from the video's captions: "For people that aren't building agentic products, but you're using Claude Code, every 6 months delete your Claude MD. Delete your skills. Delete your hooks. See what the model does and it might surprise you."
Read the opening condition. It's scoped to people who aren't building agentic products. Most reposts drop it. If your repo ships AI into a clinical workflow, you're closer to the case he excluded than the one he addressed.
He gave the opposite advice in February 2026: "Invest in your CLAUDE.md. After every correction, end with: 'Update your CLAUDE.md so you don't make that mistake again.'" Follow that for months and you get exactly the file the delete advice targets. A one-off correction sits next to a rule from a spec, in the same voice, with nothing to tell them apart. The habit that wrote the crutches also wrote your domain rules down as prose. That's why you can't delete blind.
"Delete your hooks" is the dangerous part. Anthropic's Claude Code best practices say the opposite for rules that can't bend: "If something has to happen every time, make it a hook, a deny rule, or a managed setting. CLAUDE.md is for guidelines, and Claude is allowed to decide a guideline doesn't apply." The same doc says the hooks to delete are the ones that enforce "things that are only preferences."
Why deleting CLAUDE.md is risky in a healthcare repo
The add-back loop works when a deletion causes a stumble. The agent stubs a function, a test fails, you add the line back. Crutches fail loudly, so the loop catches them.
Domain rules fail like this:
entered-in-errornot filtered. FHIR R4 uses that Observation status for a result withdrawn after release. Skip the filter and the summary cites a lab that should never have existed. It reads perfectly.- A
system/scope requested. In SMART App Launch,system/scopes are for backend services with no user. Ask for one from a user-facing app and nothing breaks. The app just sees far more than it should. I've covered why system/ scopes are god mode. - OBX unit dropped. OBX-5 holds the value and OBX-6 holds the unit in a separate field. A parser that loses OBX-6 produces a bare number. No error is raised.
- Card built without prefetch. CDS Hooks 2.0 makes prefetch optional for the client. When it's missing, the service has to query the
fhirServeritself, or return 200 with an emptycardsarray. An agent that skips both writes a service whose card says the patient has no recent A1c, because it never looked.
Every one of these looks like success. The tests the agent wrote pass. The card renders. A week of normal work proves nothing, because the situation the rule guards against may never come up that week. It's the same class of bug as the silent failures I keep running into in production: the output is confident and wrong, and nothing goes red.
The crutch evidence is real, and it tells you nothing about this. In AY Automate's benchmark, a legacy CLAUDE.md with four "always use me" skills passed the same hidden tests as an empty repo at 2.1x the cost. The tasks were generic Python. No task in that suite could expose a dropped OBX-6.
Sort every CLAUDE.md rule: crutch, convention or domain rule
Go through every line in CLAUDE.md, every skill and every hook. Each gets one of three labels:
- Model crutch. Corrects a model habit. "Read the file before editing." "Don't be lazy." ALL CAPS emphasis. These are the deletion candidates.
- Team convention. Commands, branch naming, where fixtures live. Keep one only if the agent can't find it by reading the code. That's Anthropic's own test.
- Domain rule. Comes from a spec or an incident. Each one gets an owner and a link to that spec or incident.
A domain rule with no source link is a warning sign. Either someone knows why it exists and never wrote it down, or it's a convention dressed up as a safety rule. Find out which before the next upgrade, not after.
How much will you cut? Reporails analyzed about 30,000 public repos and says 73% of a typical instruction file is scaffolding. Your number will differ, and it isn't the one that matters. What matters is that every line you keep for safety is enforced.
The sort produces a list like this. One entry per line, wherever it lived:
# rules.yaml: every line from CLAUDE.md, skills and hooks lands here
- id: R3
text: Never request system/ scopes from a user-facing app
kind: domain # crutch | convention | domain
owner: integrations-lead
source: https://build.fhir.org/ig/HL7/smart-app-launch/scopes-and-launch-context.html
enforced_by: [hooks/no-system-scopes.sh, ci/lint-scopes]
- id: R9
text: Read the file before editing
kind: crutch
owner: none
enforced_by: none # deletion candidate
Turn domain rules into Claude Code hooks before you delete anything
Prose that asks the model to remember a rule is a guideline the model may skip. It doesn't count as a control, any more than our MedScrub skill configs did. Before any deletion, each domain rule becomes something deterministic:
entered-in-error: a fixture bundle that contains one, and a contract test that asserts it never reaches the output.system/scopes: a PreToolUse hook for the agent and a CI lint rule for everyone else.- OBX units: parser fixtures where every value must come out with its unit, or fail.
- Missing prefetch: two contract tests. One sends no prefetch but a
fhirServerandfhirAuthorization, and expects the service to query the server. The other sends neither, and expects 200 with{"cards": []}.
The scopes hook is short. On PreToolUse, exit code 2 blocks the tool call. Cover every tool that writes files, not just Edit.
#!/usr/bin/env bash
# PreToolUse on every file-writing tool. Exit 2 blocks the edit.
trap 'echo "R3 hook failed; blocking." >&2; exit 2' ERR
text=$(jq -r '[.tool_input.new_string, .tool_input.content,
(.tool_input.edits[]?.new_string)] | map(select(. != null)) | join("\n")')
if grep -Eq 'system/[A-Za-z*]+\.' <<<"$text"; then
echo "Blocked (R3): user-facing apps never request system/ scopes. Use patient/ or user/." >&2
exit 2
fi
Use a command hook, not a prompt or agent hook. Those ask another model to decide, so they aren't deterministic. Anthropic's docs also say to set onFailure: "block", so a hook that crashes or times out stops the edit instead of waving it through. The trap is a second line of defense for the same failure.
This is the same move as turning every correction into a lint rule, a type or a better API, and the same reason the agent doesn't get to say done on interface code.
How to test which CLAUDE.md lines to keep
Don't delete and watch for a week. Run an experiment.
Take a fixed set of past agent tasks from the repo. Real work, not toy prompts. Run them against de-identified HL7v2 and FHIR fixtures in three arms:
- Full config, as it is today.
- Stripped config: crutches and conventions removed. Domain checks stay on.
- Add-back config: stripped, plus only the lines arm 2 showed were needed.
Compare pass rate, rework (corrections before the change is mergeable) and tokens. Run each arm more than once. When RedHub repeated its own three-way skill test, two of three skills got a different verdict the second time. One run is a hint, not a result.
Two things make this different from the generic version of the experiment.
First, the fixtures must contain the trigger for every domain rule: the withdrawn Observation, the prefetch-less request, the OBX segment with a unit. If the trigger isn't in the replay, the replay can't see the rule. A generic task suite will pass clean and tell you nothing.
Second, keep the domain checks on in every arm. A stripped config that tries to request a system/ scope trips the hook. Count that as a measured failure. You learned something, and no chart was touched.
What to add back to CLAUDE.md
Add back only lines whose removal caused a measured failure across repeated runs. Everything else stays deleted. The always-on prompt should be as small as you can get it, to keep the agent in the smart zone.
Domain rules are the exception. They stay as enforced checks whatever the replay shows. A clean stripped run means the new model didn't trip the check on these fixtures. It doesn't mean the check is unnecessary. If the stripped arm keeps hitting the same hook, add back one line that points at the check, so the agent stops wasting turns. The check is the control. The line is a hint.
Audit CLAUDE.md after every model upgrade
Treat a model upgrade like any other change to a clinical system. Rerun the replay on every upgrade and record it with the model version: date, model ID, config hash, results for each arm, and which lines came back. Your target model will be deprecated. When it is, you want a record of what the config looked like against each version, not a guess. The rerun also catches the opposite case: a newer model that needs a line the old one didn't.
Track two numbers per repo. Domain rules enforced by code rather than prose: target 100%. Incidents traced to a deleted rule: target zero, and a nonzero count means a domain rule got labeled a crutch. Line count before and after is nice to know. It's the least important number on the sheet.
A smarter model never knew your domain
The pitch for deleting is that the newer model doesn't need the old rules. For crutches, that's true, and I'd delete them without guilt. But a domain rule was never about how smart the model is. No model upgrade teaches it that your feed sends units in OBX-6 or that a user-facing app has no business holding system/ scopes. Those rules exist because of a spec or an incident, and they'll still be true on the next model and the one after it. The model got better at coding. It didn't get better at your patients.
Questions people ask
Should I delete CLAUDE.md after a model upgrade?
Yes for lines that correct old model habits, like ALL CAPS emphasis or "don't be lazy." In a clinical repo, first move every domain rule into a hook, lint rule or test, because a missing domain rule usually fails silently.
Should I delete Claude Code hooks along with CLAUDE.md?
Not enforcement hooks. Anthropic's best practices say rules that must happen every time belong in a hook, deny rule or managed setting, and the hooks to delete are ones that enforce only preferences.
How do I test which CLAUDE.md lines to keep?
Replay a fixed set of past agent tasks on de-identified fixtures with the full config, a stripped config and an add-back config, and compare pass rate, rework and tokens. Run each arm more than once, keep domain checks on in every arm, and make sure the fixtures contain the trigger for every domain rule.
What is the difference between a CLAUDE.md crutch and a domain rule?
A crutch corrects a model habit and fails loudly when removed, so the add-back loop catches it. A domain rule comes from a spec or incident, like filtering entered-in-error resources, and its absence often breaks nothing you can see.