A compact gas sensor has been developed for the first time employing a quantum cascade laser (QCL) with a central wavelength of 4.32 μm, combined with direct absorption spectroscopy technology and a hollow waveguide. The sensor could measure the concentrations of four isotopic molecules (16O12C16O, 18O12C16O, 16O13C16O, and 17O12C16O) in CO2 gas simultaneously, thereby obtaining the relative isotope ratios of δ13C, δ18O, and δ17O. By adjusting the incident light path, the anomalous absorption peaks in the system have been effectively suppressed, and a compact feedback function generator has been integrated to ensure control of the laser output wavelength to eliminate the loss of measurement precision caused by wavelength fluctuations. Under the two conditions of free-running and wavelength-controlled, a standard CO2 sample with a concentration of 5 % was measured continuously. The results showed that under wavelength-controlled conditions, the precision of the four isotopic molecule concentration measurements was improved by a minimum of 1.8 times, and the measurement precision could be further improved after filtering. According to the Allan variance analysis, the detection precision for δ13C, δ18O, and δ17O were 0.7 ‰, 0.62 ‰, and 1.58 ‰, respectively, at the optimal integration time of 98 seconds. This study has the potential for respiratory diagnosis to detect simultaneously the values of δ13C, δ18O, and δ17O in exhaled samples.