Sensitivity analysis (SA) is the study of how changes in the inputs of a model affect the outputs. SA has many applications, among which uncertainty quantification, quick evaluation of close solutions, and optimization. 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. The aim of this work is to define and approximate 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 show how this procedure can be applied to the Euler barotropic system with different finite volumes methods.