I've experimented with this before, and found that my caffeine-assisted productivity hit its highest levels when I had a cup of coffee every three days or so. More frequently and I built up too much tolerance; less frequently and the stimulant effects were too powerful when I did drink it, giving me distractibility and a tendency to fixate that weren't made up for in alertness and mental agility.
Your body chemistry might vary, of course. Also, that's peak, not sustained, productivity; you're probably better off with a steady intake of caffeine if whatever you have to do will take more than a day or two.
L-theanine is synergistic with caffeine and reduces the agitation that comes from taking too much. Jump-off link
Thus spake Eliezer:
It seems that many here might have outlandish ideas for ways of improving our lives. For instance, a recent post advocated installing really bright lights as a way to boost alertness and productivity. We should not adopt such hacks into our dogma until we're pretty sure they work; however, one way of knowing whether a crazy idea works is to try implementing it, and you may have more ideas than you're planning to implement.
So: please post all such lifehack ideas! Even if you haven't tried them, even if they seem unlikely to work. Post them separately, unless some other way would be more appropriate. If you've tried some idea and it hasn't worked, it would be useful to post that too.