Better know a Wikipedia article: Staircase wit

“Staircase wit,” or l’esprit de l’escalier:

L’esprit de l’escalier or esprit d’escalier (staircase wit) is thinking of a clever comeback when it is too late. The phrase can be used to describe a riposte to an insult or any witty remark that comes to mind too late to be useful—when one is on the “staircase” leaving the scene of the encounter. The phenomenon is usually accompanied by a feeling of regret at not having thought of it when it was most needed or suitable. The French encyclopedist Denis Diderot originally described this situation in his Paradoxe sur le comédien. […]

The Seinfeld episode “The Comeback” humorously explores the concept of “staircase wit.”

Ah, George. Story of my life. Via the ever-wonderful Ask Metafilter. [ed.—Post #300.]