Muscle twitching (the medical term is fasciculation) is very common and usually not serious, although chronic, persistent twitching can be quite annoying. Muscles twitch when they involuntarily contract and release. The most common sites for twitching are the eyelid, calf or thumb.
Twitching tends to occur most often when you're tired or after you've been exercising strenuously. Eyestrain, stress and anxiety, fatigue and too much caffeine can also play a role, and a number of prescription drugs (including diuretics, corticosteroids or estrogens) can cause twitching as a side effect. If you're taking one of these or any other medications, ask your physician or pharmacist if twitching is a side effect. Most of the time, twitching goes away on its own, but it can continue for weeks or months. There is no medical treatment for ordinary twitching.
Since twitching is so common, I would first recommend cutting back on your caffeine intake and trying some simple relaxation techniques such as my relaxing breath,progressive relaxation or massage. Slow stretching can often help relieve twitching. You also could try taking calcium and magnesium supplements. Both minerals are key to healthy neurological function and muscle control. Start with 200 mg of magnesium a day (citrate, glycinate, or chelate) and slowly increase the dose toward 500 mg a day until you notice a difference. Keep in mind that for many people, 500 mg of magnesium can cause loose bowels (taking it with calcium decreases this susceptibility). When taking calcium and magnesium supplements together, the typical ratio is two parts calcium to one part magnesium.
If these measures don't help, ask your physician to refer you to a neurologist for a workup that should be able to identify – or eliminate – any neurological concern. A number of serious (and rare) neurological diseases can be responsible for muscle twitches but most of them cause other symptoms as well, including muscle weakness or atrophy.
Andrew Weil, M.D.