I often climb a lot but have only gotten cramps once, and that was on a very hilly (14,000+ feet of climbing) double century.
That said, I always eat before a ride, usually a large breakfast and then add Perpetuem for quick on-the-bike nutrition (the flavor I like, Café Latte, has caffeine) and whether it's an organized ride of just a training ride, I usually drink sodas, most often Coke.
Other friends who do get cramps have used pickle juice or mustard packets to relieve cramps. Maybe vinegar is the common ingredient that gets rid of cramps! Maybe.
Here's a sample of a ride I did recently:
https://www.strava.com/activities/630257808
I have gotten "speed wobble" on occasional (thankfully rare) fast descents but your method of putting your knees against the top tube has always worked for me. And yes, I've experienced it on steel, aluminum, titanium and carbon bikes.