Pro Tools 2018 offers a handy new feature called Retrospective MIDI Record. To be clear this is not some feature that offers to take your tracks back to the good old days of vintage recording... if only! What Retrospective MIDI Record does is 'listen' to the incoming MIDI on an armed track and if you forget to hit record during a moment of genius (your words not ours) then after the take you can hit Shift C to place the idea you just tried onto the track, as if you had pressed record in the first place.
Many DAWs offer similar features like Logic, Cubase and Live, so it's nice to see this handy little feature in Pro Tools 2018.
However if you would like to have that option but own an earlier version of Pro Tools then we have some good news for you, for $6.99 there's a Mac app called Capture MIDI that offers retrospective recording and more. Capture MIDI sits in your Finder and listens to any input coming in on the track selected in your DAW. If you miss record then simply open up the Capture MIDI interface and drag in the performance you missed onto the Pro Tools timeline. It's that simple and as we say offers a lot more besides including transpose as well as an audio loop browser.
We have tested Capture MIDI and it works great, building up every idea you've been jamming and then letting you drag and drop it into the timeline of your DAW.