Abstract Recent numerical simulations have demonstrated that transverse coronal loop oscillations are susceptible to the Kelvin–Helmholtz (KH) instability due to the counterstreaming motions at the loop boundary. We present the first analytical model of this phenomenon. The region at the loop boundary where the shearing motions are greatest is treated as a straight interface separating time-periodic counterstreaming flows. In order to consider a twisted tube, the magnetic field at one side of the interface is inclined. We show that the evolution of the displacement at the interface is governed by Mathieu’s equation, and we use this equation to study the stability of the interface. We prove that the interface is always unstable and that, under certain conditions, the magnetic shear may reduce the instability growth rate. The result, that the magnetic shear cannot stabilize the interface, explains the numerically found fact that the magnetic twist does not prevent the onset of the KH instability at the boundary of an oscillating magnetic tube. We also introduce the notion of the loop σ-stability. We say that a transversally oscillating loop is σ-stable if the KH instability growth time is larger than the damping time of the kink oscillation. We show that even relatively weakly twisted loops are σ-stable.