Blindsnakes, Ramphotyphlops nigrescens, are small wormlike fossorial snakes that feed principally on the larvae and pupae of ants. Examination of stomach contents showed that larger blindsnakes consumed larger prey items than, and different prey species from, smaller blindsnakes. Only the largest snakes consumed brood of the large and formidable 'bulldog ants', Myrmecia. Three hypotheses for the causal basis of this size-related shift in dietary habits were tested. Observations on captive snakes suggested that they are gape-limited predators, and the prey items eaten by small snakes in the field are as large as they could physically ingest in the laboratory. Hence, the absence of large prey items from small snakes may be due simply to gape-limitation. However, medium-sized blindsnakes were capable of ingesting items larger than those that they take in the field. The absence of Myrmecia in the diets of these snakes is not due to prey choice (Myrmecia were readily eaten in the laboratory) or to an inability to locate or follow pheromonal trails of this ant genus, because all size classes of blindsnakes readily followed Myrmecia trails in the laboratory. Instead, the absence of Myrmecia from the diets of smaller snakes is probably due to the snakes' size-dependent vulnerability to nest defence by the bulldog ants. In laboratory encounters, Myrmecia workers were able to bite and sting (and eventually kill) small blindsnakes, but larger snakes were relatively invulnerable to attack.