Abstract The physical structures built by animals are considered extended phenotypes that reflect how organisms make decisions and deal with changes in their biotic and abiotic environment. We summarize the results of several studies on Myrmeleon crudelis, a neuropteran larva that digs pit-traps in the soil to capture small arthropods (mostly ants) in the tropical dry forests of Costa Rica. Specifically, we showed how this species responds to varying biotic and abiotic conditions with changes in the design and/or location of its pit traps. Several experiments and field comparisons indicate that: 1) antlions adjust the pit design according to the abundance and type of prey. When prey is scarce, antlions increased trap diameter, an architectural adjustment that enhances the probability of prey encounter. Antlions that experienced high prey abundance, but the prey easily escaped, then increased pit depth, an adjustment that increases the chance of prey retention; 2) soil compaction strongly reduced pit-trap size and abundance; 3) antlions preferred soils with high proportion of fine-particle size to build pits. In fine-grained soil, pit-traps are larger and more efficient to capture prey than traps in coarse-grained soils; and 4) pit-traps may also be affected through indirect effects of soil structure and vegetation cover. Areas with fine-soil presented less plant cover, and plant cover could be beneficial for antlions because it acts as a shelter against direct sunlight and rainfall, or it may represent a cost because it is a source of leaflitter falling in the pits. The works summarized here how trap-building predators can exhibit considerable flexibility in trap construction in response to various biotic and abiotic factors, emphasizing how the study of extended phenotypes can be a useful approach to better understand the flexibility of foraging behaviors.