This might be a target for CBT, SSRI, or exposure therapy for anxiety or panic symptoms. Learning to feel good and not panicking while drinking moderate amounts of caffeine.
Institute of Medicine
One potential risk of high doses of caffeine, which needs further
substantiation, is a dose-related decrement in mental functioning. A number of
researchers have found that high doses of caffeine can adversely affect mental
performance. Although a relatively low dose of caffeine (250 mg) ~Four Espressos, produced
favorable subjective effects (e.g., elation and pleasantness) and enhanced
> performance on cognitive tasks in healthy volunteers, higher doses (500 mg) led
to less favorable subjective reports (e.g., tension, nervousness, anxiety,
restlessness) and less improvement in cognitive performance than placebo.
Negative effects may be more pronounced in nonusers than in regular users of
caffeine. Excessive intake of caffeine (caffeinism) may be mistaken for anxiety
Caffeine has been shown to produce anxiety or panic attacks in individuals with agoraphobia or
panic disorders, but not in healthy controls (Boulenger et al., 1984; Charney et al., 1985).
And from the New York Times
Yes, coffee is good for you — but it depends on the kind of coffee you’re drinking and in what quantity.