Fat is stored or mobilized according to food availability. Malfunction of the mechanisms that ensure this coordination underlie metabolic diseases in humans. In mammals, lysosomal and autophagic function is required for normal fat storage and mobilization in the presence or absence of food. Autophagy is tightly linked to nutrients. However, if and how lysosomal lipolysis is coupled to nutritional status remains to be determined. Here we identify MXL-3 and HLH-30 (TFEB orthologue) [corrected] as transcriptional switches coupling lysosomal lipolysis and autophagy to nutrient availability and controlling fat storage and ageing in Caenorhabditis elegans. Transcriptional coupling of lysosomal lipolysis and autophagy to nutrients is also observed in mammals. Thus, MXL-3 and HLH-30 orchestrate an adaptive and conserved cellular response to nutritional status and regulate lifespan.