The supply demand imbalance of energy facilitates the development of unconventional oil and gas, particularly shale reserves. Herein, the mechanism of N2- and CH4-assisted CO2 slug flooding in wedge-shaped pores is studied by molecular dynamics simulations. The results show that in the process of N2-assisted CO2 flooding, CO2 can form a sufficient mutual solubility effect with the oil phase in the pore II (pore size 3 ∼ 8 nm) when CO2 is preflooded, and the postinjected N2 has a strong driving ability, so the mutual solubility of the CO2/oil phase can be better displaced. For N2 preflooding, the gas channel is preferentially formed in the pore II, and the vortex-like movement is formed at the entrance of the pore I (pore size 8 ∼ 3 nm). In the process of CH4-assisted CO2 flooding, the preflooding of CO2 has a better displacement effect. However, in the preflooding of CH4, the phenomenon of gas channeling easily occurs, which leads to the decrease in the displacement effect in the pore I. In addition, the siphon phenomenon can be observed for all flooding. CO2 flooding and its slug flooding would produce the phenomenon of CO2 migration between pores. Overall, N2 and CH4 assistance in CO2 flooding improves oil displacement and recovery efficiency in reservoir pores, offering a superior method for enhanced oil recovery in nanopore structures. The slug displacement method demonstrates a greater efficiency than the single gas methods, highlighting its potential for improving oil recovery in intricate nanopore structures.