The code is made up of digits from 1 to 4 and differs from save to save; after the dream, it's in your notes at the bottom right. The reward permanently raises Health, Stamina and Focus. If you bring Lucia, both of you get the boost and you get extra dialogue.