"Mass loss through various channels (winds, binarity, pulsations, etc.) determines the evolutionary path and final fate of massive stars, but it is yet poorly understood. This is especially true for the very late stages of stellar evolution. Conversely, pair-production driven pulsations at the end of the evolution the most massive stars (with helium core masses >~30Msun) is quite well understood from a theoretical point of view. In this talk, I will present models of stars going through the pulsational pair instability and associated episodic mass ejections, focusing in particular on the consequences for (i) the surrounding material at core-collapse and (ii) a potential binary companion. Pair-production driven pulsations are naturally fine-tuned to happen in the last thousands years to months before the final core-collapse, depending o the helium core mass of the star. The collisions among ejected shells could produce supernova imposters, and/or precursor signals. The pulses can produce layers of hydrogen-poor circumstellar material, especially if the hydrogen-rich envelope has been lost previously to a binary companion. The change in mass due to these pulsations can modify the binary orbit and the final black hole mass and spin, resulting in observable signatures in the mass range already probed by gravitational wave detections. "