I have a lot of trouble with cramps. I am trying not to over-analyze, that didn’t work for me.
I use Vitalyte or Nuun in the water bottle from the start. Don’t want to get behind on the water/electrolyte balance. Pickle juice also works for me for relief, you can even buy little bottles of it. For whatever reason, electrolyte designers love to put potassium in their products, but it is corrosive and can cause nausea. Which unfortunate, because I take a medication that elevates potassium levels and too much can kill you.