Sleep deprivation impairs a wide range of cognitive processes, but the precise mechanism underlying these deficits is unclear. One prominent proposal is that sleep deprivation impairs vigilant attention, and that impairments in vigilant attention cause impairments in cognitive tasks that require attention. Here, we test this theory by studying the effects of caffeine on visual vigilant attention and on placekeeping, a cognitive control process that plays a role in procedural performance, problem solving, and other higher order tasks. In the evening, participants (N = 276) completed a placekeeping task (UNRAVEL) and a vigilant attention task (the Psychomotor Vigilance Task [PVT]) and were then randomly assigned to either stay awake overnight in the laboratory or sleep at home. In the morning, participants who slept returned to the lab, and all participants consumed a capsule that contained either 200 mg of caffeine or placebo. After an absorption period, all participants completed UNRAVEL and PVT again. Sleep deprivation impaired performance on both tasks, replicating previous work. Caffeine counteracted this impairment in vigilant attention but did not significantly affect placekeeping for most participants, though it did reduce the number of sleep-deprived participants who failed to maintain criterion accuracy. These results suggest that sleep deprivation impairs placekeeping directly through a causal pathway that does not include visual vigilant attention, a finding that has implications for intervention research and suggests that caffeine has limited potential to reduce procedural error rates in occupational settings.