Oh, nice! So, there's quite a bit going on here, bear with me. The caterpillar looks to be a tobacco hornworm, Manduca sexta. Judging by its size it already did a number on your tomato plant (despite their name they feed on more than tobacco). Well, rest assured it's toast. Those white things are cocoons made by a parasitoid wasp, probably Cotesia congregata. In other words, at some point a wasp came by and laid a bunch of eggs in the caterpillar. It would never have lived long enough to become a moth. However, I recommend you check all your plants for more caterpillars, as it is the caterpillars that damage plants. They're very hard to spot if not already parasitized like this, but bug poop ("frass" is the scientific term, looks like pellets) and missing leaves give them away too. I hear chickens love them.
While the caterpillar is a pest on cultivated tomato plants, it's a native insect that feeds on a native plant, Jimsonweed. It just happens they can feed on many plants in the Solanaceae plant family, which includes tomatoes, tobacco, eggplants, and others. If the caterpillars are lucky enough to not be parasitized then they'll dig into the ground and pupate (the pupa is the lifestage between larva and adult, called a chrysalis for butterflies and moths). The adults are fantastic pollinators. I've seen them come to cactus flowers a few times and they're more like hummingbirds than moths. UV lights also attract them, which is how we collect 'em.
So, to sum up: Your caterpillar pest has been neutralized by parasitoid wasps! Congrats!
Oh, for those wondering, parasitoids are parasites that routinely kill their host. Tapeworm: parasite. Facehugger from Aliens: parasitoid.