I was forced to cut way back on caffeine after some limited sober time because it started making my anxiety go through the roof. Not sure why I never had that problem when I was still drinking, but now I can't drink more than one or 2 cups of regular coffee in the morning without being a nervous wreck for a while.
The headaches are most likely from withdrawal....you are drinking a LOT of caffeine.