Clavaminate synthase from Streptomyces clavuligerus is an Fe(II)/2-oxoglutarate dependent dioxygenase, crucial for the biosynthesis of the β-lactamase inhibitor clavulanic acid. It catalyses three consecutive oxidative reactions, i.e. hydroxylation, cyclisation and desaturation in a single binding cavity. As follows from the results of this QM/MM study, CAS versatility and selectivity depends on the binding cavity, which interplays differently with substrate for each reaction. The enzyme-substrate interactions affect the substrate’s ability to re-position during the reaction, either constraining it in its primary position, which impedes processes other than oxygen rebound, or allowing change, which facilitates double bond formation. This differential effect originates from two aspartate residues, which strongly interact with the guanidine group of the hydroxylation substrate and stabilise orientation of the molecule. These residues interact less effectively with a smaller amine group of the desaturation substrate(s), aiding their repositioning and subsequent formation of a double bond.© 2020 Wiley-VCH GmbH.