We currently lack a robust noninvasive method to measure prefrontal excitability in humans. Concurrent TMS and EEG in the prefrontal cortex is usually confounded by artifacts. Here we asked if real-time optimization could reduce artifacts and enhance a TMS-EEG measure of left prefrontal excitability. This closed-loop optimization procedure adjusts left dlPFC TMS coil location, angle, and intensity in real-time based on the EEG response to TMS. Our outcome measure was the left prefrontal early (20-60 ms) and local TMS-evoked potential (EL-TEP). In 18 healthy participants, this optimization of coil angle and brain target significantly reduced artifacts by 63% and, when combined with an increase in intensity, increased EL-TEP magnitude by 75% compared to a non-optimized approach. Real-time optimization of TMS parameters during dlPFC stimulation can enhance the EL-TEP. Enhancing our ability to measure prefrontal excitability is important for monitoring pathological states and treatment response.