In situ 31P solid-state NMR studies of mechanochemical halogen bond formation provide insights into the cocrystallisation process and an estimate of the activation energy.