Same with kittens. Cats have full control of their claws, a properly socialized cat will rarely accidentally scratch you (although if they get too excited playing or don't recognize it's you - feet under covers - or are kneeding they might, but not on purpose). They usually learn this from interacting with other kittens in the litter, but the same concept applies to help train them.