Capillariasis is diagnosed through a stool sample. It is treated by medications which are also used to treat other parasitic worm infections. These medications are given for 20 days for new cases and 30 days for relapse cases. Eggs and parasites disappear from the stool within 4 days, and symptoms disappear within a week of taking the medications.