a cocoon is a shell made of silk by most kinds of moth caterpillars and other insect larvae. some butterfly larvae (in the family hesperiidae and subfamilies parnassiinae and satyrinae) do spin cocoons. however, most butterfly pupae are called chrysalids. some caterpillars attach small twigs or pieces of vegetation to the outside of their cocoon to hide it from predators. others spin their cocoon in a hidden place. examples would be on the underside of a leaf, in a crevice, or down near the base of a tree trunk.