These 3-4” caterpillars like to eat tomato leaves and other solanaceous crops. It is the larval stage of the five spotted hawk moth or sphinx moth. These are the large 4-5” moths you see flying around from time to time. Often you can just handpick the caterpillars off or plant an extra tomato plant and move to it. If you see the caterpillar with white projections from its body, leave it on the plant or move it to the tomatoes in the Rows for the Hungry. The caterpillar has been parasitized by beneficial insects called braconid wasps. They use the caterpillar as a food source and then hatch to parasitize other hornworms. Hornworms can do damage, especially when there are many of them. One or two will not significantly hurt your tomato plant. Allow those that are parasitized to stay on the plant as the wasps hatch and will attack the very small hornworms that are not noticeable. To read all about it, here’s a link.
https://hnr.k-state.edu/extension/info-center/common-pest-problems/common-pest-problem-new/Tomato%20Hornworm.pdf
https://hnr.k-state.edu/extension/info-center/common-pest-problems/common-pest-problem-new/Tomato%20Hornworm.pdf