I still sleep with my son on occasion (he doesn't have to fall asleep with me anymore
) and he does the same. I found a pair of mitts that someone gave me for him when he first came home from the hospital. I popped those on him and no more scratching. His nails are very short, yet it's still quite painful when he scratches! He's also hitting and the mitts do "muffle" it in a way.
I want to add, the mitts he has has a sort of drawstring around the wrist so they stay on. I had tried socks but he just pulled them off somehow.