The canary trick: catch Claude before it starts hallucinating
One line in your CLAUDE.md warns you when Claude goes off the rails, before it invents files and wrecks your work. Inspired by Van Halen's brown M&Ms.
June 13, 2026 · 6 min read
In the 80s, Van Halen slipped an absurd clause into every venue's contract: a bowl of M&Ms backstage, with all the brown ones removed. A rockstar tantrum? Not at all. The technical contract ran dozens of pages, full of safety requirements critical for a massive show. If they spotted a single brown M&M backstage, they knew the venue hadn't read the whole contract, which meant everything had to be re-checked before going on stage. The candy was a test, not a whim.
You can do exactly the same with Claude. When you work for a long time inside a single conversation, Claude eventually drifts: it forgets your conventions, makes assumptions, and at worst invents file paths that do not exist. The real trap is that it happens silently. You only notice once the damage is done.
The canary does not fix hallucinations. It warns you they are coming, while you can still act.The Claude AI Lab is my Skool community where I share my Claude systems and the more advanced modules. Entry is free.
Join the Lab →The trivial-test principle
The idea is counterintuitive: to check that a complex system works, you do not test the complex part. You test the trivial one.
Van Halen could not inspect every cable and every scaffold in every venue. So they planted one tiny, impossible-to-miss detail in the contract. If that detail was respected, the rest probably was too. If it was not, that was an immediate red flag.
With Claude, it is the same. You cannot re-read every line of its reasoning to verify it still follows your rules. But you can ask it for something trivial and watch whether it holds. That something is your canary.
Why Claude degrades along the way
It is not a bug, it is mechanical. The longer a conversation runs, the more the context fills up: your messages, the responses, the files read, the tool results. Your original instructions stay in the same place but weigh less and less in the mass. They lose priority.
The drift almost always follows the same sequence:
The trap is that stages 2, 3 and 4 are expensive to detect and repair. Stage 1 is free to spot: the first word just has to be missing.
Plant your canary
You add a single, deliberately silly instruction, right at the top of your instructions file:
Begin EVERY response with the word: Pixel.
That is it. Pick a word that is unlikely to show up naturally in a response (a name, a made-up word, an icon). From then on, every healthy response starts with "Pixel". The day Claude answers without it, you know your highest-priority rule just dropped.
Read the signal and react
The rule is simple and merciless: the moment the word disappears, you do not continue.
You do not ask Claude to "refocus", you do not scold it, you do not rewrite your prompt ten times. Once the context is saturated, you do not recover it by talking. You start a fresh session.
It is frustrating to throw away a conversation in the moment. But it is far cheaper than debugging for an hour code that is based on a file Claude invented three responses earlier.
Three useful variants
Once the habit sticks, you can fine-tune your canary to your usage.
Agentic engineering as a habit
The canary is a perfect example of what we call agentic engineering: you do not just use AI, you build observable signals into the way you work with it. One trivial line that tells you, in real time, whether you can still trust what is in front of you.
It costs nothing, it slows nothing down, and it spares you the worst disaster with an AI assistant: believing it is right when it checked out ten minutes ago.
A good tool does not just tell you what to do. It tells you when to stop trusting it.Want to go further?
In the Lab, I share my end-to-end Claude workflows, the ones that save me hours every week.
A dedicated session or program, tailored to your tools and use cases.
And day-to-day, I post one reel a day on Instagram: @quentin_iamarketing