How Opinionated Rules Prevent Claude Production Incidents
Every team that ships Claude into production eventually hits the same wall.
The first prototype works.
The demo goes well.
Then real traffic arrives, and the app starts doing things nobody predicted - calling the wrong tool, burning through budget, returning a refusal with no fallback, or leaking a system prompt detail it should never have said out loud.
None of these are bugs in Claude.
They are gaps in the decisions the team never made explicit.
This page lays out the mental model behind that failure pattern, and why replacing ad hoc, case-by-case prompting with a small set of opinionated, written-down rules is the single highest-leverage move a tech lead can make before shipping a Claude-powered feature.
Summary
- Core Idea: Production incidents in Claude apps are rarely caused by model failures - they are caused by decisions that were made once, informally, and never turned into a rule anyone else could follow or enforce.
- Why It Matters: Ad hoc prompting scales linearly with the number of engineers touching the codebase and the number of edge cases they happen to think of; opinionated rules scale with review, not memory.
- Key Concepts: ad hoc prompting, opinionated rules, decision drift, incident class, rule enforceability.
- When to Use: Before a Claude feature reaches real users, when a second engineer starts touching the same agent code, and immediately after any incident whose root cause is "we forgot to handle that."
- Limitations / Trade-offs: Rules that are too rigid slow down legitimate experimentation, and a rule nobody enforces is just documentation nobody reads.
- Related Topics: model selection policy, prompt hygiene, tool design, cost governance, security guardrails.
Foundations
Ad hoc prompting is what happens by default.
An engineer writes a system prompt to solve the problem in front of them.
It works, so it ships.
Six weeks later a different engineer adds a new tool call, and the original prompt's assumptions quietly break, because nothing wrote those assumptions down anywhere a second person could find them.
Opinionated rules are the alternative.
A rule is a decision that has already been made, stated plainly enough that anyone on the team can apply it without re-deriving the reasoning from scratch.
"Use Haiku for classification tasks under 500 tokens of input" is a rule.
"Use whichever model feels right for the task" is not a rule - it is an invitation for every engineer to make a different, locally-reasonable, globally-inconsistent choice.
The distinction matters because Claude, like any large language model, is extremely good at doing exactly what it is asked and only moderately good at guessing what it was supposed to be asked when the prompt is vague.
A vague prompt does not fail loudly.
It fails quietly, in ways that only show up as an aggregate pattern across thousands of production requests - slightly wrong tone here, an unnecessary tool call there, a cost spike nobody traces back to its source for weeks.
A simple analogy: ad hoc prompting is like a team with no coding style guide.
Every file looks locally reasonable, and the codebase as a whole is unreviewable, because there is no shared standard to check any individual decision against.
Opinionated rules are the style guide - not because creativity is bad, but because consistency is what makes review, debugging, and onboarding possible at all.
Mechanics & Interactions
Production incidents in Claude apps tend to fall into a small number of recurring incident classes, and each class traces back to the absence of a specific rule:
- Model-tier mismatches. A latency-sensitive classification endpoint quietly gets routed through Opus because nobody wrote down which task complexity maps to which model tier, so the on-call engineer who added the endpoint picked whatever felt safe.
- Context bloat. A conversational agent's prompt grows every sprint as engineers append "just one more instruction," until the accumulated context degrades response quality and nobody can tell which instruction is still load-bearing.
- Unscoped tools. A tool meant to look up account balances is given broad database access "just in case," and an unexpected input sequence uses that access in a way the original author never intended.
- Untracked spend. Nobody set a per-team token budget, so a single overzealous agent loop burns a month's inference budget in a weekend before anyone notices the invoice.
- Silent guardrail gaps. A tool call that writes to a production system was never explicitly gated behind confirmation, because the original prototype only ever ran against a staging environment.
Each of these is preventable, and each is preventable by the same mechanism: writing the decision down as a rule before the incident, not as a retrospective action item after it.
This is where decision drift comes in - the gradual divergence between what a team believes its Claude app does and what it actually does, accumulated one un-reviewed local decision at a time.
Decision drift is invisible from inside a single pull request.
Each individual change looks like a small, sensible addition.
It only becomes visible in aggregate, usually during an incident review, when someone reconstructs the timeline and realizes the system prompt has been edited by six different people with six different mental models of what "helpful" means in this context.
Rules interrupt decision drift by giving every contributor the same starting point.
# Ad hoc: every call site re-derives "which model for this task"
model = "claude-opus-4-8" if "hard" in task_description else "claude-sonnet-5"
# Rule-driven: the decision is made once, referenced everywhere
from claude_rules import select_model
model = select_model(task=task_description, latency_budget_ms=800)The rule-driven version is not smarter than the ad hoc version on any single call.
Its value is that the same decision, applied consistently across a hundred call sites, produces a system whose behavior a tech lead can actually reason about - and change deliberately, in one place, instead of hunting down every scattered variant.
Advanced Considerations & Applications
Rules do not eliminate judgment - they relocate it.
Instead of every engineer exercising judgment independently, at the moment they happen to be writing a call site, judgment gets exercised once, deliberately, by whoever owns the rule, and reviewed periodically as the product and the model lineup evolve.
This has a second-order effect that matters more as a team scales: rules are auditable in a way that scattered ad hoc decisions are not.
When an incident happens, "which rule did we violate, and why" is a answerable question.
"What was the engineer thinking six months ago when they wrote this prompt" usually is not, especially once that engineer has moved to a different team.
Rules also change the failure mode of incidents from silent to loud.
A codebase with an explicit rule ("all destructive tool calls require confirmation") turns a violation into something a code reviewer or a linter can catch before merge.
A codebase with only an implicit norm turns the same violation into something that only surfaces after it has already caused damage in production.
| Approach | Strength | Weakness | Best Fit |
|---|---|---|---|
| Ad hoc, case-by-case prompting | Fast to prototype, no upfront cost | Drifts silently, unreviewable at scale, repeats mistakes | Early exploration, single-engineer prototypes |
| Opinionated, written-down rules | Reviewable, enforceable, consistent across the team | Requires upfront investment, can ossify if never revisited | Any Claude feature touching real users or real budget |
| Rules enforced only by convention | Cheap to adopt, no tooling required | Erodes the moment a new engineer joins who never learned the convention | Small, stable teams with low turnover |
| Rules enforced by lint/review gates | Catches violations before merge, scales with team size | Needs tooling investment and periodic maintenance | Teams past the first few engineers or the first production incident |
The pattern that shows up repeatedly across teams that have shipped Claude successfully is not that they never made mistakes - it is that each mistake became a rule, and the rule prevented the same mistake from recurring in a different call site written by a different engineer.
That compounding effect, more than any single clever prompt, is what separates a Claude app that gets more reliable over time from one that accumulates incidents at a constant rate no matter how much engineering effort goes into it.
Common Misconceptions
- "Rules mean we can't be flexible." - Rules constrain the default path, not every path. A good rule set has an explicit, reviewed exception process, not a blanket prohibition on judgment calls.
- "We're too small a team to need this." - Decision drift starts with the second person who touches the code, or the first time the original author forgets their own reasoning six months later. Team size accelerates the problem; it does not cause it.
- "If the model is good enough, prompting details don't matter." - A more capable model executes an ambiguous instruction more confidently, not more correctly. Capability amplifies the cost of an unclear rule rather than making the rule unnecessary.
- "Rules are the same thing as documentation." - Documentation describes what the system does. A rule is enforceable - it can be checked in review, in a lint pass, or in a test. Unenforced documentation degrades into decision drift just as fast as no documentation at all.
- "We'll write the rules after we ship." - Retrofitting rules onto a codebase full of ad hoc decisions requires first reconstructing what those decisions were, which is exactly the information that ad hoc prompting fails to preserve.
FAQs
What counts as a "rule" versus just good advice?
- A rule is specific enough to check: it names a condition and a required action.
- "Use Haiku for tasks under 500 tokens of input" is a rule.
- "Think carefully about cost" is advice - true, but not enforceable by anyone other than the person who already agrees with it.
Doesn't writing rules up front slow down early prototyping?
Yes, slightly - and that trade-off is usually worth accepting only once the prototype is heading toward real users or real budget. Early, throwaway exploration can stay ad hoc; the moment a second engineer or real traffic touches the code, the cost of drift starts exceeding the cost of writing the rule down.
Who should own a team's Claude rules?
Typically the tech lead or a small rotating group, the same way a team owns its coding style guide. Ownership matters less than the rule being written down somewhere reviewable and revisited when the model lineup or the product changes.
How is this different from just writing a longer system prompt?
A system prompt encodes rules for the model's behavior at inference time. The rules this page describes are broader - they cover engineering decisions like model selection, tool scoping, and budget limits that happen outside any single prompt, in code, review, and process.
What's the first sign that a team needs explicit rules?
An incident review where the root cause is some version of "we forgot to handle that" or "different parts of the codebase do this differently." That sentence is the signal that a decision existed only in one person's head.
Can rules become outdated as new Claude models ship?
Yes, and that is expected - a rule tied to a specific model's cost or latency profile needs revisiting when the model lineup changes. The fix is a periodic review cadence, not avoiding rules because they might need updating.
Do rules replace the need for monitoring and observability?
No. Rules reduce how often incidents happen; observability is how a team detects the incidents that happen anyway, including violations of the rules themselves. The two are complementary, not substitutes.
Is there a risk of having too many rules?
Yes - a rule set so large that nobody can hold it in their head stops being usable and starts being ignored, which is functionally identical to having no rules. The core-rules list in this section exists precisely to keep the enforceable set small and memorable.
How do opinionated rules relate to "decision drift"?
Decision drift is the disease; rules are the prevention. Drift happens when the same type of decision gets made differently by different people over time. A rule fixes the decision once so it stops drifting.
Are rules only about preventing bad outcomes, or do they also help good ones happen faster?
Both. A written rule saves every future engineer the time of re-deriving a decision from scratch, which speeds up legitimate development just as much as it prevents mistakes - the same way a style guide speeds up code review, not just prevents bad code.
What happens when a rule turns out to be wrong?
It gets revised, the same way any other piece of engineering documentation gets revised - through review, not through quietly ignoring it in one call site while leaving it technically "in force" everywhere else.
Does this apply equally to a single-engineer side project and a large team?
The mechanism is the same, but the urgency scales with team size and traffic. A solo engineer's "rules" can live in their head longer before drift causes damage; a team of ten cannot rely on any one person's memory.
Related
- The Core Claude Rules: A Quick-Reference List - the condensed, single-page version of the rules this page motivates.
- Model Selection Rules: When to Use Opus, Sonnet, or Haiku - the first concrete rule set this mental model applies to.
- Security Guardrail Rules Every Tech Lead Should Enforce - the incident class with the highest cost when a rule is missing.
- Claude Rules Best Practices - every rule across this section distilled into one list.
Stack versions: Written against the Claude model lineup current as of ~June 2026 - Claude Fable 5, Claude Opus 4.8, Claude Sonnet 5 (the default), and Claude Haiku 4.5 - and the official
anthropicPython SDK (latest 0.x release). Model names, pricing, and SDK versions move quickly - verify current specifics at platform.claude.com/docs before relying on them.