Grammicin (Gra) is derived from the endophytic fungus Xylaria grammica EL000614 and shows nematicidal activity against the devastating root-knot nematode Meloidogyne incognita in-vitro, in planta, and in-field experiments. However, the mechanism of the nematicidal action of Gra remains unclear. In this study, Gra exposure to the model genetic organism Caenorhabditis elegans affected its L1, L2/3, L4, and young adult stages. In addition, Gra treatment increased the intracellular reactive oxygen species (ROS) levels of C. elegans and M. incognita. Molecular docking interaction analysis indicated that Gra could bind and interact with GCS-1, GST-4, and DAF-16a in order of low binding energy, followed by SOD-3, SKN-1, and DAF-16b. This implies that the anthelmintic action of Gra is related to the oxidative stress response. To validate this mechanism, we examined the expression of the genes involved in the oxidative stress responses following treatment with Gra using transgenic C. elegans strains such as the TJ356 strain zIs356 [daf-16p::daf-16a/b::GFP + rol-6 (su1006)], LD1 ldIs7 [skn-1p::skn-1b/c::GFP + rol-6 (su1006)], LD1171 ldIs3 [gcs-1p::GFP + rol-6 (su1006)], CL2166 dvIs19 [(pAF15) gst-4p::GFP::NLS], and CF1553 strain muIs84 [(pAD76) sod-3p::GFP + rol-6 (su1006)]. Gra treatment caused nuclear translocation of DAF-16/FoxO and enhanced gst-4::GFP expression, but it had no change in sod-3::GFP expression. These results indicate that Gra induces oxidative stress response via phase II detoxification without reduced cellular redox machinery. Gra treatment also inhibited the nuclear localization of SKN-1::GFP in the intestine, which may lead to a condition in which oxidative stress tolerance is insufficient to protect C. elegans by the inactivation of SKN-1, thus inducing nematode lethality. Furthermore, Gra caused the mortality of two mutant strains of C. elegans, CB113 and DA1316, which are resistant to aldicarb and ivermectin, respectively. This indicates that the mode of action of Gra is different from the traditional nematicides currently in use, suggesting that it could help develop novel approaches to control plant-parasitic nematodes.