We employ global input–output analysis to quantify amplification of exogenous disturbances in compressible boundary layer flows. Using the spatial structure of the dominant response to time-periodic inputs, we explain the origin of steady reattachment streaks in a hypersonic flow over a compression ramp. Our analysis of the laminar shock–boundary layer interaction reveals that the streaks arise from a preferential amplification of upstream counter-rotating vortical perturbations with a specific spanwise wavelength. These streaks are associated with heat-flux striations at the wall near flow reattachment and they can trigger transition to turbulence. The streak wavelength predicted by our analysis compares favourably with observations from two different hypersonic compression ramp experiments. Furthermore, our analysis of inviscid transport equations demonstrates that base-flow deceleration contributes to the amplification of streamwise velocity and that the baroclinic effects are responsible for the production of streamwise vorticity. Finally, the appearance of the temperature streaks near reattachment is triggered by the growth of streamwise velocity and streamwise vorticity perturbations as well as by the amplification of upstream temperature perturbations by the reattachment shock.