Developing efficient gas sensing materials for monitoring lithium batteries thermal runaway gases is essential for human safety. In this study, a detailed examination of the CH4, CO2, CO, and H2 adsorption property for the h-BN with metal clusters modification was conducted utilizing density functional theory. The incorporation of metal clusters (Pd4, Rh4, and Ru4) significantly improved the adsorption energy and charge transfer of h-BN towards gases compared to the unmodified h-BN. The Ru4/h-BN system demonstrated the highest adsorption capacity across all four gases, while the Pd4/h-BN system displayed remarkable recovery ability at room temperature (298 K). Furthermore, studying the adsorption mechanism via DOS revealed enhanced gas adsorption due to orbital hybridization. The work offers reliable theoretical foundation for the detection and prevention of thermal runaway gases in lithium batteries through the use of h-BN modified with metal clusters.