I get them mostly in my neck and lower arms and hands. They seem to be pretty random, though I'm definitely more prone to them when tired or stressed out. If they are happening only when you perform a certain action, there's also a chance it could related to posture - something putting pressure on a certain nerve where it passes a joint, for example.
When when I'm coming out of being hyper-focused, I get something similar to the "brain reconnecting with body" effect that KennyIOM mentioned, too. It feels like my body is testing all of the muscles beginning at my neck and working outwards to my hands and feet. It's more of a "writhe" than a "jerk", spread over a second or two, I only get the body-wide spasm if I'm on the edge of sleep (common for neuro-typical brains too, called the "hypnic jerk".)
_________________
When you are fighting an invisible monster, first throw a bucket of paint over it.