Traps are an efficient method of capturing prey for ambush predators, but trap building and maintenance are costly. We describe suitable hunting sites for pit-building antlion larvae living in sand dunes based on its cost–benefit relationship. In the field, antlion pits were located near natural barriers, such as cliffs, rocks and vegetation, but not closest to these barriers. Our results show that this pattern of pit location did not differ between populations; neither with or without the influence of a specific dipteran parasitoid of antlion larvae. Artificial pitfall traps deployed in their habitats revealed that invertebrates move along barriers, likely through thigmotaxis (wall hugging or wall-following), and drop sands in the traps set at barrier edges. In the laboratory, repeated artificial destruction of pits from larval antlions induced frequent pit relocation and rebuilding. This task reduces life history parameters, such as the larval growth and food conversion rates, suggesting a high cost of pit maintenance. Thus, antlion pits might shift away from barrier edges where more prey is available but pit destruction occurs more frequently due to wall-following invertebrates. Such disturbance may explain why antlions are not located closest to these barriers.