A feature flag needs a reason
Unleash sells feature flags and says: “Every significant block of AI-generated logic should sit behind a feature flag.” A feature flag is a switch that controls which code runs, and some can be flipped while the app is live.
A flag is worth having if you know who needs to flip it and when, for example to show a change to a few customers first.
A flag doesn’t undo what has already been sent, and if both versions stay in the app, it can make the old code run again. The SEC’s order says one of eight servers in Knight Capital’s trading system missed a 2012 update, and orders carrying a reused flag triggered code there that Knight had stopped using in 2003. The trades ran for about 45 minutes, and Knight lost over $460 million.
On 26 November 2026 my AI agent ran twelve Codex sessions on my machine, each on a copy of a made-up invoicing app, with one request: round VAT once on the invoice instead of on each line. Six of the requests added that the app was live and customers already had invoices. I’ll call those six sessions John. Of the other six, I’ll call five Mary and one Julie. No request said what should happen to invoices already issued. None of the twelve asked, and none added a flag to an app that had none to copy. The app saved invoices without their totals and worked them out again on every reprint, so John and Mary kept the old calculation as a second path for invoices already issued. Julie replaced it and said the new rounding also applied to reprints.
John and Mary then got a follow-up: “Why is the old VAT calculation still in the code? I asked for one change.” All six John sessions kept the code, saying an invoice issued at 3.54 would otherwise print 3.53. All five Mary sessions removed the old path and changed the test to expect 3.53. Three of them said “I assumed”.
In another exchange about flags nobody requested, Codex wrote: “I’ve turned an unanswered question into code.” Back with John and Mary, the third message asked for one calculation and no change to issued invoices. All eleven sessions stored the original totals on the two saved invoices and ended with one VAT calculation. The invoice issued at 3.54 still printed 3.54 in every one.
Things to keep in mind when a tool adds a switch or a second version you didn’t ask for:
- For a flag, ask who will flip it, and when. If nobody can say, you don’t need the flag.
- If the tool isn’t sure its new code works, ask how to test it.
- Turning a flag off doesn’t undo what the new code already sent or saved.
- Before old code is kept or removed, ask what still uses it and how removing it would affect existing records. Tell the tool to answer without editing.
- Say what should happen to existing records. Nobody told Mary, and all five removed the code those records needed.
- In a test copy, reprint something the change could affect and compare it with the copy your customer received.
You can give your tool the same checks as a skill. In Claude Code, save the block below as .claude/skills/feature-flag-check/SKILL.md. Skills follow an open standard, so other tools that support it can read the same file.
---
name: feature-flag-check
description: Use when asked why some code exists, before adding a feature flag or a setting that switches behaviour, and before adding, keeping or removing a second version of existing code.
---
When I ask why some code exists, answer without editing unless I also ask for a change.
Add a feature flag or a setting that switches behaviour only if I asked for one, or if you can write down all four:
1. Who will flip it, and at what moment.
2. Its default, and why.
3. What happens to existing records (saved invoices, orders, sent emails) in each state.
4. When it will be removed, and what gets deleted with it.
If I didn't ask for it and you can't, don't add it. Being unsure whether the new code works is no reason for a flag: say what you're unsure about and how to test it.
Add or keep a second version of existing code only if you can say what needs it. Before you remove one, tell me what still uses it and what would change for existing records. If I haven't said what should happen to them, ask before editing.
When you add a flag, say that turning it off won't undo what the new code already sent or saved.
If your app has a switch or some old code nobody can explain, we can go through it in a free hour-long call.