Has Kitty gone from sleeping on your bed to sleeping in the litter box? No, she hasn't lost her mind. She's sending you a message. Litter-box sleeping is a sign that something's wrong. What? It might take some detective work to figure that out, so be patient.
Find out why Kitty is doing that. Have you just moved? This could be a sign of anxiety about the new surroundings. Kitty just came from a shelter? She might be used to living in a cage, so your nest's large open spaces are scary. Is she going to the toilet with regularity or not? Too many or not enough litter box visits could mean she's feeling sick and lying there to comfort herself.
Get a vet's opinion if you suspect something's wrong. Cats with urinary tract infections are known to sleep in litter boxes because of the constant urge to urinate. Is Kitty exhibiting other signs of illness, such as refusing his favorite food, meowing through the night, avoiding your lap? Get the carrier out and head to the vet.
Add an additional litter box to the house if you have several cats. Sleeping in the litter box could be Kitty's way of saying "Paws off! This one is mine!" It's a common behavior in multiple-cat homes. Some finicky cats don't like smelling other cats in their litter box and will sleep in it so they don't have to share it. Adding an additional one or two could solve the problem.
Remove stressors. Whether you have an annoying puppy or an annoying niece, Kitty might have decided he can't deal with that. Rather than having to navigate the house to avoid them so he can get to the litter box, he might decide it's just easier to move there. Either move the litter box to a quieter area of the house or train the dog -- and the niece -- to leave Kitty alone.