For myself, I think I am just defective. I first noticed something odd a couple of decades ago. I was taking computer courses and one of them was a typing class. I discivered cannot type in the "qwerty position" without my left pinky cramping up. So I think that's all associated. Maybe some damage I did to myself when I was young?
Things I find help cause it
Thin necks and heavy barre chording (solos actually help loosen it back up -- sometimes!)
Playing with the guitar too high or too low. I generally do not sit while playing, except with the acoustic. The acoustic is just a different shape and size and I can play for hours sitting. I cannot play any electric too long in a sitting position, I need to be standing. I do not know why the difference, except for the size and shape ot the guitar.
Things that help me:
Just stop and shake it out. If you can. Sometimes it just goes away.
Give yourself a break but keep playing. Being concious of the problem I try to organise set lists with some logic to address/avoid it.
Try some different guitar heights. For me it is a balance: Too high and it bothers my right hand. Too low and it starts to bother my left.
Thick necks. I'm not 100% on this, but I do think it helps. And you would not have to spend a lot. I see Epi Specials on Kijiji all the time for $100. Big fat neck for you to try. Or maybe rent something to try it out.
Good luck !!
...so ever since then, I always hang on to the buckle.