Some buddhist sleep meditations are often called clear light meditations.
For them btw is not the trick to remember the thoughts but to stay aware when transitioning to the sleep phase, this is one of the moments clear conciousness can be experienced according to certain teachings.