Best practices switching environments in software projects

One of the most important things to consider when working on different environments (Development, Staging, Production, etc.) in the same project, is to not confuse them.

Different environments tend to be very similar, if not identical. It is not uncommon to have exactly the same thing deployed on similar machines but that have different roles.

One thing that helps me is the use of colors as environment indicators. For example, these are the colors I often see when I manage a production environment:

It is annoying to see so much red, but that reminds me that I shouldn't work too much time on a production machine. An error there could have immediate consequences.

The screenshots above and below are from WinSCP, a free SFTP client for Windows that, a part from having other features, allows you to attach different colors to sessions. The color is also visible on the session selection screen:

Putty, and its improved fork Kitty, allows to do the same thing for SSH:

Now that I'm looking at the Kitty website, I see that it even supports having a different icon for each session. It may help.

I also use Environment Indicator Drupal module.