Ontogenetic shifts in habitat use are widespread, especially in ectothermic taxa in which juveniles may be an order of magnitude smaller than large adult conspecifics. The factors that generate such habitat shifts are generally obscure, but we studied an unusual system that allowed us to compare consequences of habitat selection between adults and juveniles. Pit-vipers (Gloydius shedaoensis) on a small island in north-eastern China feed almost entirely on seasonally migrating birds. During the spring bird-migration period, individual snakes consistently re-used either arboreal or terrestrial ambush sites. Snakes in trees were smaller (and more philopatric) than snakes on the ground. This ontogenetic shift in habitat use may reflect the difficulty of capturing birds on the ground, especially by small snakes. In laboratory trials, large (adult) pit-vipers struck faster, further and more accurately than did small (juvenile) snakes. In experiments with free-ranging snakes, the proportion of strikes hitting the bird was lower for juveniles than for adults, and lower for terrestrial snakes than for arboreal snakes. Additionally, adult snakes generally seized the bird by the head whereas juveniles frequently struck the body or wings (and thus, obtained a less secure grip). Arboreal ambush sites may facilitate prey capture not only because they give access to smaller birds but also because they render the bird's location more predictable and, hence, enable the snake to position itself optimally prior to the prey's arrival. Because juvenile pit-vipers are less capable strikers, and are small relative to available prey items, they may benefit from the greater ease of prey capture from branches. Thus, the ontogenetic shift in habitat selection within this species may be because of ontogenetic shifts in the vipers’ ability to capture and ingest large, mobile prey.