This paper uses a general equilibrium framework to examine the effects of temperature on firm-level demand, productivity, and input allocation efficiency, deriving an aggregate damage function for climate change. Using data from Italian firms and detailed climate data, it uncovers a sizable negative effect of extreme temperatures on firm-level productivity and revenue-based marginal product of capital. Based on these estimates, the model generates aggregate productivity losses from local temperature fluctuations that are higher than previously thought, ranging from 0.60 to 6.82 percent depending on the scenario and the extent of adaptation. Notably, these losses are approximately four times greater than those estimated by averaging firm-level losses in a representative firm model, which does not capture frictions that alter allocative efficiency in a heterogeneous firm setting. Therefore, incorporating our framework into Integrated Assessment Models is likely to revise upwards the estimated economic costs of climate change.