Probely due to irritation of the tip mabey by soap even hot water or by washing power.
I'm assuming you mean you feel this twinge of sharp pain through the shaft from genitals to head, while doing anything, not urinating? If so, then to allay any worries, it's definitely not severe. People have commonly mistaken them to UTI's (Urinary tract infections), but that's pain and burning with urination. The 1-3 second long twinge of pain that can nearly bring you to your knees is a nerve stem being hit or twisted the wrong way. It happens when sitting or laying on your back, and can happen without even moving. The best idea to make it stop is to completely change positions or get up and start moving if you're sitting/laying.
If the problem occurs more than a few times a day, definitely see a neurologist or urologist and get some workup, as well as if you have it with any burning pain or with urination.
Hope it helps!
you may have passed a kidney stone if it happens when you pee.