The wormsorter facilitates genetic screens in Caenorhabditis elegans by sorting worms according to expression of fluorescent reporters. Here, we describe a new usage: sorting according to colonization by a GFP-expressing pathogen, and we employ it to examine the poorly understood role of pathogen recognition in initiating immune responses.