The availability of powerful differencing algorithms is crucial to track the evolution of source code, for example with the purpose of monitoring clones or vulnerable statements. In this paper we present a language-independent approach to track the evolution of code fragments, based on a novel differencing algorithm, that overcomes limitations of the Unix diff. We show how the algorithm is able to track the evolution of code elements in real-world software systems with acceptable precision, and provide examples-such as clone tracking and vulnerability tracking-where the algorithm has been successfully applied.