My son goes in phases. Until he was around 7 months old, he had no problem at all sleeping alone for long stretches in our bed. I'd even unlatch before he was totally asleep, and he'd suck his thumb to sleep. Or sometimes (this was when he was around 3-4 months old), he'd want to play with me rather than sleep, so I would just leave him -- and he'd babble to himself while staring at his hands and actually fall asleep! Then he developed separation anxiety when he turned 7mo... and nothing has been the same since.
Now I just creep away slowly, bit by bit. Also, I start to move my body away (like my legs) before he's asleep, so I'm not all snuggled up against him when he does fall asleep. Then I just go in at 20 minutes, 40 minutes, 1 hour, whatever, and nurse him again -- it's usually just a quick top-up and not difficult like putting him down in the first place. These days it's about 60-90 minutes. The days of every 20 minutes until I come to bed are over, thank goodness.
On the other hand, getting him to go to bed in the first place has become a nightmare now that he's 9mo. We'll be nursing lying down, and he'll flip on his front and try to stand up, pushing on my chest&stomach as support -- while trying to stay latched! If I lay him back down, he throws a tantrum. Fun times.
He's more clingy for naps than nightsleep. I can hardly get away. Sometimes I just nap with him or read a book.
P.S. I have a Snug Tuck pillow on his side of the bed, and I put my head pillows on my edge when I'm not there. When he wakes, he either lies there and waits for me, or he crawls to the edge of the pillows and waits. I don't know if he has a sense of the edge, or if I just respond quick. I've been trying to teach him about edges -- I don't know if he really understands. Anyway, he's never rolled off the bed or crawled off.