This happens with me and my dog. It's actually kind of our ritual. She'll sleep at the foot until she gets cold, then when I'm close to falling asleep she climbs up and waits for me to hold open the sheets so she can climb in and curl up to my back.