Knowledge of feeding habits not only contributes information related to the resources that individuals need to survive and breed, but also leads to insights about the interactions between a species and its environment. The optimal foraging theory explains diet selection by several attributes of the trophic scenario such as availability, diversity, quality and predictability of food. Other models propose that digestive tract mass increases under high metabolic demands by cold, affecting food choice and intake. Thus, diet selection emerges as a behavioural trait shaped by intrinsic and extrinsic factors. The goal of our study was to determine variation in the trophic scenario among sites at different elevations, as well as variation in phenotypic traits relevant to the nutritional and energy balance in Phyllotis xanthopygus. This small rodent is widely distributed along the Andes Mountains. We assessed diet selection and digestive tract size in individuals collected at three elevations across its distribution range. Results on dietary proportion of specific trophic categories (green parts, fruits and arthropods) showed that P. xanthopygus alternates between omnivory and granivory/frugivory. Richness, diversity and quality of the available resources evidenced a relatively low-quality trophic scenario at high altitude. Nevertheless, the diets built in by animals from diverse altitudes lacked differentiation in quality or diversity. P. xanthopygus seems to behaviourally compensate environmental variation to cope with nutritional requirements, by changing diet composition and proportion of items included. The resultant uniform diet quality is consistent with the absence of variation in the gastrointestinal tract size. Considering the spatial variability and seasonality of the region, a behavioural response is probably the most convenient strategy to overcome short-term environmental heterogeneity. In a plastic species such as P. xanthopygus, behaviour is a fundamental aspect to take into account by predictive models in the forecasts of climate change effects on biological diversity.