We introduce a method for detecting discontinuities in piecewise smooth functions and in their derivatives. The method is constructed from a local stencil of grid point values and is based on a polynomial annihilation technique. By varying the order of the method and the arrangement of the corresponding stencils, the jump discontinuities of a function and its derivatives can be identified with high order accuracy. The method is efficient and robust and can be applied to non-uniform distributions in one dimension.