Chimpanzees (Pan troglodytes) build nests at night for sleeping and occasionally during daytime for resting. Over the course of seven years, forest fragments in Bulindi, Uganda, were reduced in size by about 80% when landowners converted forest to agricultural land. However, unlike other studies on nesting behavior in response to habitat disturbance, chimpanzees at Bulindi had no opportunity to retreat into nearby undisturbed forest. To understand behavioral adaptations to forest clearance, we compared Bulindi chimpanzees' nesting characteristics before and after this period of major deforestation. After deforestation, chimpanzees built nests at lower heights in shorter trees, and reused a larger proportion of their nests. Additionally, average nest group size increased after deforestation, even though community size declined by approximately 20% over the same period. The substantial decrease in available forest habitat may have caused the chimpanzees to aggregate for nesting. However, more cohesive nesting may also have been influenced by dietary shifts (increased reliance on agricultural crops) and a need for enhanced safety with increased human encroachment. Conversely, the chimpanzees selected similar tree species for nesting after deforestation, apparently reflecting a strong preference for particular species, nested less often in exotic species, and built integrated nests (constructed using multiple trees) at a similar frequency as before fragment clearance. Chimpanzees living in unprotected habitat in Uganda, as at Bulindi, face mounting anthropogenic pressures that threaten their survival. Nevertheless, our study shows that chimpanzees can adjust their nesting behavior flexibly in response to rapid, extensive habitat change. While behavioral flexibility may enable them to cope with deforestation, at least to a certain point, the long‐term survival of chimpanzees in fast‐changing human‐modified landscapes requires intensive conservation efforts.