When upstairs tub valve is opened for the first time in the evening, loud banging noise sometimes ensues from pipes. Banging is alleviated when supply is redirected to showerhead, or when water is turned off.

Single-handle Pegasus (Home Depot) valve. No issues when supply is off (not "water hammer").

Appreciate any feedback. More specifics available if needed. Thanks.