Nest-building in primates
Certain extant strepsirrhines (lemurs and lorisoids) and hominid apes (humans, chimpanzees, gorillas and orangutans) build nests for both sleeping and raising families. Hominid apes build nests for sleeping at night, and in some species, for sleeping during the day. Nest-building by hominid apes is learned by infants watching the mother and others in the group, and is considered tool use rather than animal architecture. Old World monkeys and New World monkeys do not nest. It has been speculated that a major evolutionary advance in the cognitive abilities of hominoids may first have occurred due to the development of nest-building behaviour and that the transition from nest-building to ground-sleeping led to "modifications in the quality and quantity of hominid sleep, which in turn may have enhanced waking survival skills through priming, promoted creativity and innovation, and aided the consolidation of procedural memories". In strepsirrhines 
Strepsirrhines may be nocturnal, diurnal, or crepuscular. Some may either occupy holes in trees or build nests. Unlike the hominid apes, strepsirrhines build nests by instinct and use them for breeding purposes. Strepsirrhines' mothers either carry their young on their bodies, conceal their young in foliage while they venture out to feed, returning periodically to feed and groom them, or leave them in a nest built for that purpose. In lemurs 

Among lemurs, females of smaller species, such as the mouse lemur and giant mouse lemur, build leaf nests before birth for the protection of their young. Leaf nests in golden-brown mouse lemurs may provide thermoregulation benefits. Male mouse lemurs have been found sharing nests with up to seven females at a time during the mating season. In the Ruffed lemur (Varecia variegata), nests are made from locally collected material and may also be lined with hair plucked from their own body. In larger lemur species such as the Verreaux's sifaka, ring-tailed lemur and common brown lemur, the young cling to the mother and nests are not built. Aye-ayes, being nocturnal, build oval-shaped nests from nearby branches and lianas for day time use. These may be built in a tangle of lianas or in a fork of a tree, at a height of  above the ground. These nests may be re-used by other aye-ayes once the original occupant moves on. A single occupant uses a nest for a few days, refreshing it regularly with fresh vegetation. Aye-ayes build and use many nests—during one study, 8 aye-ayes were recorded to build and use as many as a hundred different nests over a period of 2 years. In lorisoids 
Lesser bushbaby mothers initially shelter their offspring, usually twins, in a nest or tree hollow, later concealing the infants in foliage while they forage at night. In some species, such as dwarf galagos, the day-sleeping nests may be shared by groups of females or occasionally by visiting males. In hominid apes 
Hominid apes construct nests during the day or by night, primarily for resting. The nests are not built using instinct but through behavioural patterns which are learned by the young from their parents or clan. Nest building is habitual behaviour, and nest-counts and faecal analysis at each nest site can be used to estimate hominid ape population counts and composition. In the case of orangutans and chimpanzees, social influences are probably essential for the animals to develop successful nesting-behaviour. The nest building behavior is estimated to have originated during the Miocene, when the body of the ancestors of modern apes increased in size. Eventually they became so big that it was no longer possible for them to get both safe and proper sleep on bare branches alone, so they started building sleeping platforms in the trees. This appeared to have happened when their weight passed 30 kilos, as only apes above 32 kilos build nests. Which in turn led to shorter and deeper sleep. In gorillas 

Gorillas construct nests for day and night use. Day nests tend to be simple aggregations of branches and leaves on the ground, while night nests are more elaborate constructions usually on the ground but sometimes on trees, especially those of juveniles and females in areas submitted to a high poaching pressure. The nests may be  wide in diameter and are constructed by individuals. Young animals nest with their mother but do not construct nests until three years of age, initially in close proximity to their mother. Gorilla nests are distributed randomly and the tree species used appears to be opportunistic. In chimpanzees 

Nest-building is seen in chimpanzees who construct arboreal night nests by lacing together branches from one or more trees. They can also build nap nests to rest in the afternoon, these are usually more poorly constructed than the night nests and can be built both on the ground and on the trees. At some research sites such as Bili forest, in Congo, chimpanzees can build a significant proportion of their night nests on the ground. Nests consist of a mattress, supported on a strong foundation, and lined above with soft leaves and twigs. Nests are built in trees which have a minimum diameter of  and may be located at a height of . Day and night nests are built. Nests may be located in groups. In orangutans 

Orangutans build day and night nests. Young orangutans learn by observing their mothers' nest-building behaviour. Nest-building is a leading reason for young orangutans to leave their mother for the first time. Starting at 6 months of age, orangutans practice nest building and gain proficiency by the time they are 3 years old. Initially, a suitable tree is located: orangutans are selective about sites even though many tree species are utilised. The foundation is then built by pulling together branches under them and joining them at a point. After the foundation has been built, they bend smaller, leafy branches onto the foundation; this serves the purpose of and is termed as the "mattress". After this, orangutans braid the tips of branches into the mattress. This increases the stability of the nest and forms the final process of nest building. Orangutans may add additional features such as "pillows", "blankets", "roofs" and "bunk-beds" to their nest. Orangutans make "pillows" by clumping together leafy branches with the leaves in the center and the twig shoots pointed outward. They bite the twigs to blunt sharp ends. Pillows are added to night nests but are usually absent from day nests. A "blanket" consists of large leafy branches with which orangutans cover themselves after lying down. Orangutans may create a waterproof overhead shelter for the nest by braiding together a loose selection of branches. They may also make a "bunk-nest" or "bunk-bed", a few metres above the main nest. In humans 

Humans build structures that can serve the same function as non-human primate nests. Modern constructions can be built with a variety of materials, the most common ones being clay, concrete, stone and wood. Early hominins did not construct structures but rather chose caves and other shelters in which to live. The emergence of built structures occurred gradually over time with the earliest structures functioning as wind breaks rather than covered huts. According to a non-verified hypothesis, archaic humans may have lived in tree houses until about 40,000 years ago. Evolution 
A study on the phylogeny of primate behaviour has revealed that the use of tree holes or nests are important in the life-history strategies of many strepsirrhine species and some New World monkey species. Alternative strategies of infant care which involve carrying the infants rather than leaving them have evolved several times but have reproductive costs and generally slower rates of population increase than species which build nests. Use of nests for leaving young is thought to have evolved from nocturnal primates with solitary habits which possibly led to the evolution of nesting and parking behaviour in strepsirrhines such as galagoes. Galagoes give birth to a single young which is left in a nest as an infant and carried to a parking place in the vegetation orally by the mothers. In addition, the use of nests or tree holes as shelters for young infants differs functionally from the use of resting places by adult animals (which may be accompanied by infants). See also 
 Ecosystem engineer
 Niche construction
 Structures built by animals
 Tool use by animals

References

External links 
 National Geographic image of Aye-aye on nest with caption "An aye-aye wakes in its arboreal sleeping nest to begin foraging." Ethology
Shelters built or used by animals
Primate behavior