Habitat loss and fragmentation are recognized as affecting the nature of biotic interactions, although we still know little about such changes for reptilian herbivores and their hindgut nematodes, in which endosymbiont interactions could range from mutualistic to commensal and parasitic. We investigated the potential cost and benefit of endosymbiont interactions between the spur-thighed tortoise (Testudo graeca L.) and adult oxyurid nematodes (Pharyngodonidae order Oxyurida) in scrublands of southern Spain. For this, we assessed the association between richness and abundance of oxyurid species with tortoises’ growth rates and body traits (weight and carapace length) across levels of habitat loss (low, intermediate and high). Furthermore, by using an intrapopulation ecological network approach, we evaluated the structure and diversity of tortoise–oxyurid interactions by focusing on oxyurid species infesting individual tortoises with different body traits and growth rates across habitats. Overall, tortoise body traits were not related to oxyurid infestation across habitats. Oxyurid richness and abundance however, showed contrasting relationships with growth rates across levels of habitat loss. At low habitat loss, oxyurid infestation was positively associated with growth rates (suggesting a mutualistic oxyurid–tortoise relationship), but the association became negative at high habitat loss (suggesting a parasitic relationship). Furthermore, no relationship was observed when habitat loss was intermediate (suggesting a commensal relationship). The network analysis showed that the oxyurid community was not randomly assembled but significantly nested, revealing a structured pattern for all levels of habitat loss. The diversity of interactions was lowest at low habitat loss. The intermediate level, however, showed the greatest specialization, which indicates that individuals were infested by fewer oxyurids in this landscape, whereas at high habitat loss individuals were the most generalized hosts. Related to the latter, connectance was greatest at high habitat loss, reflecting a more uniform spread of interactions among oxyurid species. At an individual level, heavier and larger tortoises tended to show a greater number of oxyurid species interactions. We conclude that there is an association between habitat loss and the tortoise–oxyurid interaction. Although we cannot infer causality in their association, we hypothesize that such oxyurids could have negative, neutral and positive consequences for tortoise growth rates. Ecological network analysis can help in the understanding of the nature of such changes in tortoise–oxyurid interactions by showing how generalized or specialized such interactions are under different environmental conditions and how vulnerable endosymbiont interactions might be to further habitat loss.