Abstract. The thermoregulation behaviour of the codling moth, Cydia pomonella, is investigated in temperature gradient experiments with larvae feeding within apples, and with mature larvae searching for cocooning sites. Feeding larvae appear to prefer the apple hemisphere with a higher temperature (i.e. they build larger cavities in the radiated, warmer part of the fruit). The proportion of larval cavities in the warmer hemisphere is positively related to increasing apple temperature on that side, as well as to the temperature difference between the warm and the cool fruit hemisphere. The mechanism in feeding larvae can be termed as cryptic basking because, during microhabitat selection, the caterpillars exploit temperature differences that are caused explicitly by incident solar radiation. Fifth-instar larvae in search of cocooning sites show no temperature preference within the large gradient offered (9–29 °C), with no difference between males and females. During larval development, the insect changes its thermoregulation behaviour in response to a possible shift in benefits of an elevated body temperature with respect to environmental conditions. Both the thermoregulation behaviour and such a shift of behavioural response should be respected when simulating body temperatures of the species.