Abstract Delayed dispersal of sexually mature offspring is a fundamental component of cooperative breeding in fungus farming ambrosia beetles. These beetles dwell in logs of recently deceased trees, where female offspring postpone reproduction and invest in alloparental care before dispersing to found a new nest. The wood quality affects investment of adult offspring in alloparental care and hence the breeder's reproductive success. This raises the question of whether dispersing breeders choose habitats strategically to optimise breeding prospects and modulate their offspring's helping propensity. To answer this question, here we tested experimentally whether during dispersal, Xyleborinus saxesenii Ratzeburg (Coleoptera: Scolytinae) uses olfactory cues emitted by mutualistic or pathogenic fungi as an information source on prospective habitat quality. As the mutualistic relationship between the fungi and beetles is obligate, fungus scent should provide a reliable source of information on habitat quality, indicating prior successful colonisation by conspecifics. We found no evidence for direct pathogen avoidance. However, the beetles clearly responded to scent of their mutualistic fungi, dependent on dispersal state. At the onset of dispersal, females avoided the scent of fungus mutualists, whereas they were attracted to them after being exhausted by an experimentally prolonged dispersal time. The observed change of preference during dispersal suggests that beetles freshly emerging from their home gallery may choose pristine habitat by avoiding mutualist scent. This might help to avoid competition with conspecifics and potential pathogen and parasite cross contamination. Exhausted beetles, however, may accept these risks and choose successfully colonised habitat to avoid starvation. State‐dependent adjustment of habitat preferences may be exhibited also in other economically impactful bark and ambrosia beetles, which prompts further study of the olfactory cues used by these beetles during dispersal.