Fundamental to any theory of capital taxation is a description of individual savings behavior. Successful descriptions of savings behavior have often resorted to the habit formation hypothesis. This paper studies the effect of habit formation on optimal capital taxes in a dynamic Mirrleesian model. We make three distinct contributions. First, we decompose intertemporal wedges (implicit capital taxes) for general time-nonseparable preferences into a wealth effect, a complementarity effect, and a future incentive effect. Second, we provide conditions under which intertemporal wedges are positive. Third, we derive a recursive formulation of constrained efficient allocations and evaluate the quantitative impact of habit formation. In a model parameterized to the U.S. economy, habit formation reduces average intertemporal wedges by about 40 percent compared to the time-separable case. Moreover, intertemporal wedges are close to zero for the largest part of the working life.