In order to acquire scientific evidence for the application of thiamethoxam (TMX) inAgaricus bisporuscultivation, residue and dissipation experiments for field trials were performed with the application of TMX in compost and casing soil, respectively. An effective QuEChERS method was established to analyze TMX and its two metabolites, clothianidin (CLO) and thiamethoxam-urea (TMX-urea), in compost, casing soil, and fruiting bodies. The results indicated that the TMX dissipation half-lives (t1/2) at dosages of 10 and 50 mg kg−1were 19.74 d (day) and 28.87 d in compost and 33.54 d and 42.59 d in casing soil, individually. TMX, CLO, and TMX-urea were observed after TMX application in compost and casing soil. For TMX applied to the casing soil, only TMX residues were detected in fruiting bodies with bioconcentration factors (BCFs) of 0.0003~0.0009. In addition, both the chronic risk quotient (RQ) and acute risk quotient (HQ) values of TMX in fruiting bodies were far less than 1, which means the dietary health risks to humans were acceptable. However, in the TMX application to the compost, these analytes were not detected in the fruiting bodies. This suggested that the application of TMX in compost was safer than in casing soil duringA. bisporuscultivation.