Prevention is the easiest way to keep caterpillar infestations from happening. Nets can be set up early in the life of the cannabis plant to prevent butterflies from laying eggs on the plant.
Maintaining a population of butterfly or caterpillar-eating animals can help prevent an infestation or clean one up. Some birds like sparrows and robins and goldfinches will eat caterpillars, so having bird boxes may help. Parasitic wasps or spiders may also be of use in controlling these pests.
Finding and destroying eggs early is ideal to prevent an outbreak, however, they are small and difficult to find if your foliage is rather dense. Keep plants well-trimmed to ensure easy inspections of plants.
Removing caterpillars can be done by either physical removal, or by spraying with an insecticide. Ideally, caterpillars should be prevented or removed by hand, especially if they are feeding near bud sites. The last resort should be to spray these pests while avoiding spraying any buds.