That's why Keith Richards kept a tape recorder on his bedside table. He credits it with capturing the famous riff for "(I Can't Get No) Satisfaction," which came to him in a dream.
https://www.rollingstone.com/music/music-news/when-keith-ric...