Ive gotten this types of cramps ever since playing guitar about 5 years ago. What I do is a simple exercise. take your index fingers, and put them together, and your thumbs together. Pull your thumbs toward you while pushing your index fingers forward. Then, once the thumbs and indexes are fully extended, push the joints of the inside of your thumbs together. May sound strange, but it really works for me.