SUMMARYIn many marine animals, adult habitat is selected by lecithotrophic (non-feeding) larvae with a limited lifespan. In generalist species, larvae may increasingly accept sub-optimal habitat over time as energy stores are depleted (ʻdesperate larvaʼ hypothesis). If the fitness cost of suboptimal habitat is too high, larvae of specialists may prolong the searching phase until they encounter a high-quality patch or die (ʻdeath before dishonorʼ hypothesis). In generalists, starvation is hypothesized to lead to a decline in inhibitory nitric oxide (NO) signaling, thereby triggering metamorphosis. Here, we document alternative functions for identified signaling pathways in larvae having ʻdesperateʼ versus ʻdeath before dishonorʼ strategies in lecithotrophic clutches of a habitat specialist, the sea slug Alderia willowi. In an unusual dimorphism, each clutch of A. willowi hatches both non-selective larvae that settle soon after hatching and siblings that delay settlement in the absence of cues from the alga Vaucheria, the sole adult food. Pharmacological manipulation of NO signaling induced metamorphosis in non-selective but not selective stages. However, decreased NO signaling in selective larvae lowered the threshold for response to habitat cues, mimicking the effect of declining energy levels. Manipulation of cGMP or dopamine production induced metamorphosis in selective and non-selective larvae alike, highlighting a distinct role for the NO pathway in the two larval morphs. We propose a model in which NO production (1) links nitrogen metabolism with sensory receptor signaling, and (2) shifts from a regulatory role in ʻdesperate larvaʼ strategies to a modulatory role in ʻdeath before dishonorʼ strategies. This study provides new mechanistic insight into how the function of conserved signaling pathways may change in response to selection on larval habitat choice behaviors.