I like config that follows me to the machine I log in to, and a variable that says “this is staging” is a good example. SSH has two halves for this, and both have to agree before anything arrives.
On the client, in ~/.ssh/config:
Host staging
SetEnv PROJECT_ENV=staging
Or for one connection, using the config syntax with -o:
ssh -o "SetEnv PROJECT_ENV=staging" host
On the server, in sshd_config:
AcceptEnv PROJECT_ENV
After reloading sshd, ssh staging 'echo $PROJECT_ENV' should print staging.
That is the catch. SetEnv gives a variable and its value in NAME=VALUE form. The server must be prepared to accept it, with the exception of TERM. By default sshd accepts no variables at all, so without an AcceptEnv line the variable never arrives.
Its sibling SendEnv copies variables from your local environment instead of setting a value in the config. It takes names, including wildcards, and the default is to send nothing.
A caveat from the sshd docs: some environment variables can be used to bypass restricted user environments, so they ask for care with AcceptEnv. I’d list exact names and avoid a bare *.
Further reading: ssh_config(5), sshd_config(5)