"involuntary and painful muscle contraction," late 14c., from Old French crampe (13c.), from a Frankish or other Germanic word (compare Old High German krapmhe "cramp, spasm," related to kramph "bent, crooked"), from Proto-Germanic *kramp-, forming many words for "bent, crooked," including, via French, crampon.
Writer's cramp is first attested 1842 as the name of a physical affliction of the hand, in discussions of translations of German medical papers (Stromeyer); also known as scrivener's palsy.