We investigate the variation of holographic complexity for two nearby target states. Based on Nielsen's geometric approach, we find the variation only depends on the end point of the optimal trajectory, a result which we designate the first law of complexity. As an example, we examine the complexity=action conjecture when the anti-de Sitter vacuum is perturbed by a scalar field excitation, which corresponds to a coherent state. Remarkably, the gravitational contributions completely cancel and the final variation reduces to a boundary term coming entirely from the scalar field action. Hence, the null boundary of Wheeler-DeWitt patch appears to act like the "end of the quantum circuit".