Technique

The Canary Trick

Catch a degrading Claude Code session before it wastes your afternoon

The Idea

In 1982 Van Halen buried one strange line deep in a 53-page tour contract: no brown M&Ms backstage. It read like a rock-star tantrum. It wasn't. The band played huge shows with heavy rigging, and the contract was full of safety-critical detail. The brown M&Ms were a tripwire — if a venue got that bit wrong, nobody had read the contract properly, and the dangerous stuff needed a second look.

You can give Claude Code the same tripwire. Plant one tiny, easy-to-spot instruction — and the moment it stops being followed, you know the rest of your instructions are slipping too. That instruction is your canary.

Set It Up In One Line

Easiest way: let Claude do it. Open a chat, paste this in, and pick a name — anything memorable and a bit silly works best, because you'll notice the instant it disappears.

Paste this into Claude
Please add a "canary" to my CLAUDE.md. Open my CLAUDE.md (create one in the project root if I don't have one) and add this near the top: ## Canary Always begin every response with the name "[YOUR NAME HERE]". This is non-negotiable and must never be omitted. Swap [YOUR NAME HERE] for the name below. If I haven't given you one, ask me before you save. → Name to use: ____________ Then tell me what you changed.

Prefer to do it by hand? Drop this near the top of your CLAUDE.md and swap in your own name:

## Canary Always begin every response with the name "Mr Tinkleberry". This is non-negotiable and must never be omitted.

From now on every healthy reply opens with that name. It costs you nothing and runs in the background of every session.

Why It Works

A session doesn't go from sharp to useless in one step — it degrades gradually. As the context window fills with code, output and back-and-forth, the model's attention spreads thin and the oldest, smallest instructions get deprioritised first.

The name prefix is the least important thing in your whole context, which is exactly why it's useful. It's the first instruction to fall off the edge — so when it goes quiet, it's telling you the model is starting to forget, while everything still looks fine.

What Happens If You Miss It

Ignore the canary and the slide is predictable. Each stage is harder to spot than the last — and more expensive to undo.

1

A small instruction gets dropped

First

The name prefix is the cheapest thing in your context, so it's the first to go. Harmless on its own — but it's the smoke before the fire.

2

Your conventions start to drift

Then

The house rules you set hours ago — naming, file structure, the way you like things done — quietly stop being followed.

3

It starts guessing

Then

Instead of asking, it fills the gaps with assumptions. The answers get confident and wrong at the same time.

4

It hallucinates

Finally

Made-up file paths, functions that don't exist, edits to the wrong place. By now the session is costing you more than it's giving back.

Reading The Signal

Name still there

Session is healthy. Keep going — your instructions are still landing.

Name gone

Start a fresh session. Carry over what matters and you'll get a sharper model back, cheaper than fighting a fading one.

One Honest Caveat

This is a smoke alarm, not a lab instrument. A single dropped name doesn't prove the rest of the session is degrading — a model can miss one instruction and be fine on the next reply. Treat it as a cheap early warning that's worth a glance, not a hard verdict. In practice, the moment the name goes is a good moment to ask yourself whether it's time to start fresh.

Inspired by the agent-naming idea popularised by Peter Steinberger and the "canary" framing that grew out of the Hacker News discussion around it. This is my own write-up of the technique — go read the originals.