Humpback whales (Megaptera novaeangliae) are cosmopolitan in distribution and most populations migrate between foraging and breeding grounds each year1,2. As capital breeders, many humpbacks reduce foraging behavior and potentially fast for a few months of the year3. Here, we present a comparative genomic analysis of the gut microbiomes from humpbacks on two breeding grounds: Gulf of California, where feeding is common4-6, and Hawaii, where feeding is extremely rare7. The humpback whale gut microbiome shows unexpected taxonomic novelty, high endemism, and coevolutionary signal. These data also suggest an imbalance in the gut community with foraging reduction, supported by the enrichment of several aerobic metabolism genes, potentially indicative of inflammation, and pathogenesis gene sets used to colonize host tissues, modulate the immune system, and lyse tissues. Pathway reconstruction revealed gut communities shared symbiotic functions including the synthesis of essential amino acids, short chain fatty acids (SCFAs), and vitamins, as well as nitrogen salvaging mechanisms and degradation of biogeochemically relevant substrates like cellulose, chitin, and wax esters (including host chitinases). Complementary sequencing and taxonomic annotation revealed that more Clostridiaceae and Oscillospiraceae genera were in foraging whales, whereas fasting samples were enriched in Erysipelotrichaceae genera, associated with gut disease8,9. These data reveal striking changes in humpback whale gut microbiomes between their feeding and breeding grounds, raise the possibility that breeding whales are more susceptible to gut dysfunction or disease, and equally important reveal how humpback whales are likely making varying biogeochemical contributions to upper ocean communities over the course of the year.