The evolution of constriction and of large prey ingestion within snakes are key innovations that may explain the remarkable diversity, distribution and ecological scope of this clade, relative to other elongate vertebrates. However, these behaviors may have simultaneously hindered lung ventilation such that early snakes may have had to circumvent these mechanical constraints before those behaviors could evolve. Here, we demonstrate that Boa constrictor can modulate which specific segments of ribs are used to ventilate the lung in response to physically hindered body wall motions. We show that the modular actuation of specific segments of ribs likely results from active recruitment or quiescence of derived accessory musculature. We hypothesize that constriction and large prey ingestion were unlikely to have evolved without modular lung ventilation because of their interference with lung ventilation, high metabolic demands and reliance on sustained lung convection. This study provides a new perspective on snake evolution and suggests that modular lung ventilation evolved during or prior to constriction and large prey ingestion, facilitating snakes’ remarkable radiation relative to other elongate vertebrates.