A diaphragm spasm is an involuntary contraction of the muscle that divides the upper abdomen and chest. A spasm may feel like a twitch or flutter and can occur with or without pain. A person may also temporarily have trouble breathing. In this article, learn what causes diaphragm spasms and when to see a doctor.