Sensitivity analysis (SA) is the study of how changes in the input of a model affect the output. Standard SA techniques for PDEs, such as the continuous sensitivity equation method, call for the differentiation of the state variable. However, if the governing equations are hyperbolic PDEs, the state can be discontinuous and this generates Dirac delta functions in the sensitivity. We aim at defining and approximating numerically a system of sensitivity equations which is valid also when the state is discontinuous: to do that, one can define a correction term to be added to the sensitivity equations starting from the Rankine-Hugoniot conditions, which govern the state across a shock. We detail this procedure in the case of the Euler equations. Numerical results show that the standard Godunov and Roe schemes fail in producing good numerical results because of the underlying numerical diffusion. An anti-diffusive numerical method is then successfully proposed.