I never have production open
Accessing production is dangerous, and the danger is easy to miss. You spend almost all of your day in development, and production looks 99% the same. Same pages, same buttons, same data shapes. It's very easy to make a change in production without realizing that's where you are.
Most teams try to fix this with a banner, a different favicon, or a red bar across the top of the admin. Those help a little. But you stop seeing them, the same way you stop seeing anything that's always on the screen.
You're always sure
I've worked with plenty of engineers who say, "Oh, I'm really good about noticing that." I believe they mean it. But in my experience, when you make this mistake, you make it with 100% confidence. You don't feel unsure and push ahead anyway. You're certain you're in development, right up until you find out you weren't.
I know because I've done it. More than once, at past jobs, I did things in production without realizing it. Being careful doesn't help when you don't know there's anything to be careful about.
So I stopped relying on noticing. What works is making it impossible to end up in production by accident.
My rule: production is never open
For the last 10 years, probably longer, I've followed one rule: I never have production open.
If I need to do something in production, I:
- Open a new incognito window.
- Sign in.
- Do the one thing I came to do.
- Close the window.
That's it. My normal browser is never signed in to production, so any tab I already have open is safe. The only way to touch production is to go through those steps on purpose, and nobody opens an incognito window and signs in by accident.
Closing the window at the end matters as much as opening it. Incognito throws away the session, so there's no production tab sitting in the background for me to wander back into an hour later, thinking it's localhost.
The same rule for the terminal
I do the same thing when I need to SSH into a production machine. In macOS Terminal it's Shell > New Window > Red Sands, which opens a new window with a bright red background. I connect, do what I need to do, and immediately exit.
A red window is hard to stop seeing, but that's not really why it works. It works for the same reason as the incognito window: production lives in its own window that I opened on purpose, and it only exists for as long as the task does. None of my normal terminal tabs is ever one ssh away from a production shell.
Why this works when banners don't
A banner asks you to notice something every time. This rule only asks you to make one decision, once, when you open the window. After that, the setup does the remembering for you.
It costs maybe ten seconds each time. That's nothing compared to explaining why a production record got changed by someone who was sure it was their local copy.