The HD 15337 (TIC 120896927, TOI-402) system was observed by the Transiting Exoplanet Survey Satellite (TESS), revealing the presence of two short-period planets situated on opposite sides of the radius gap. This offers an excellent opportunity to study theories of formation and evolution, as well as to investigate internal composition and atmospheric evaporation. We aim to constrain the internal structure and composition of two short-period planets situated on opposite sides of the radius valley:\ HD 15337 b and c. We use new transit photometry and radial velocity data. We acquired 6 new transit visits with the CHaracterising ExOPlanet Satellite (CHEOPS) and 32 new radial velocity measurements from the High Accuracy Radial Velocity Planet Searcher (HARPS) to improve the accuracy of the mass and radius estimates for both planets. We re-analysed the light curves from TESS sectors 3 and 4 and analysed new data from sector 30, correcting for long-term stellar activity. Subsequently, we performed a joint fit of the TESS and CHEOPS light curves, along with all available RV data from HARPS and the Planet Finder Spectrograph (PFS). Our model fit the planetary signals, stellar activity signal, and instrumental decorrelation model for the CHEOPS data simultaneously. The stellar activity was modelled using a Gaussian-process regression on both the RV and activity indicators. Finally, we employed a Bayesian retrieval code to determine the internal composition and structure of the planets. We derived updated and highly precise parameters for the HD 15337 system. Our improved precision on the planetary parameters makes HD 15337 b one of the most precisely characterised rocky exoplanets, with radius and mass measurements achieving a precision better than 2<!PCT!> and 7<!PCT!>, respectively. We were able to improve the precision of the radius measurement of HD 15337 c to 3<!PCT!>. Our results imply that the composition of HD 15337 b is predominantly rocky, while HD 15337 c exhibits a gas envelope with a mass of at least $0.01\ M_ oplus$. Our results lay the groundwork for future studies, which can further unravel the atmospheric evolution of these exoplanets and offer new insights into their composition and formation history as well as the causes behind the radius gap.