Does modafinil causes severe headache?

It can. During clinical trials of Modafinil for narcolepsy, obstructive sleep apnea (osa), and shift work disorder (swd) in adults, headaches were reported more frequently in patients receiving Modafinil than the placebo (34% vs 23%), however only 2% found the side effect so severe that they discontinued treatment.