structural:scholar_edition, structural:summarization
Anti-predator adaptations

Phasmatodea species exhibit mechanisms for defense from predators that prevent an attack from happening in the first place (primary defense), and defenses that are deployed after an attack has been initiated (secondary defense).

The defense mechanism most readily identifiable with Phasmatodea is camouflage, in the form of a plant mimicry. Most phasmids are known for effectively replicating the forms of sticks and leaves, and the bodies of some species (such as Pseudodiacantha macklotti and Bactrododema centaurum) are covered in mossy or lichenous outgrowths that supplement their disguise. Remaining absolutely stationary enhances their inconspicuousness. Some species have the ability to change color as their surroundings shift (Bostra scabrinota, Timema californica). In a further behavioral adaptation to supplement crypsis, a number of species perform a rocking motion where the body is swayed from side to side; this is thought to mimic the movement of leaves or twigs swaying in the breeze. Another method by which stick insects avoid predation and resemble twigs is by entering a cataleptic state, where the insect adopts a rigid, motionless posture that can be maintained for a long period. The nocturnal feeding habits of adults also help Phasmatodea to remain concealed from predators.

In a seemingly different method of defense, many species of Phasmatodea seek to startle the encroaching predator by flashing bright colors that are normally hidden, and making a loud noise. When disturbed on a branch or foliage, some species, while dropping to the undergrowth to escape, will open their wings momentarily during free fall to display bright colors that disappear when the insect lands. Others will maintain their display for up to 20 minutes, hoping to frighten the predator and convey the appearance of a larger size. Some, such as Pterinoxylus spinulosus, accompany the visual display with the noise made by rubbing together parts of the wings.

Some species, such as the young nymphs of Extatosoma tiaratum, have been observed to curl the abdomen upwards over the body and head to resemble ants or scorpions in an act of mimicry, another defense mechanism by which the insects avoid becoming prey. The eggs of some species such as Diapheromera femorata have fleshy projections resembling elaiosomes (fleshy structures sometimes attached to seeds) that attract ants. When the egg has been carried to the colony, the adult ant feeds the elaiosome to a larva while the phasmid egg is left to develop in the recesses of the nest in a protected environment.

When threatened, some phasmids that are equipped with femoral spines on the metathoracic legs (Oncotophasma martini, Eurycantha calcarata, Eurycantha horrida, Diapheromera veliei, Diapheromera covilleae, Heteropteryx dilatata) respond by curling the abdomen upward and repeatedly swinging the legs together, grasping at the threat. If the menace is caught, the spines can, in humans, draw blood and inflict considerable pain.

Some species are equipped with a pair of glands at the anterior (front) edge of the prothorax that enables the insect to release defensive secretions, including chemical compounds of varying effect: some produce distinct odors, and others can cause a stinging, burning sensation in the eyes and mouth of a predator. The spray often contains pungent-smelling volatile metabolites, previously thought to be concentrated in the insect from its plant food sources. However, it now seems more likely that the insect manufactures its own defensive chemicals. Additionally, the chemistry of the defense spray from at least one species, Anisomorpha buprestoides, has been shown to vary based on the insect's life stage or the particular population it is part of. This chemical spray variation also corresponds with regionally specific color forms in populations in Florida, with the different variants having distinct behaviors. The spray from one species, Megacrania nigrosulfurea, is used as a treatment for skin infections by a tribe in Papua New Guinea because of its antibacterial constituents. Some species employ a shorter-range defensive secretion, where individuals bleed reflexively through the joints of their legs and the seams of the exoskeleton when bothered, allowing the blood (hemolymph), which contains distasteful compounds, to discourage predators. Another ploy is to regurgitate their stomach contents when harassed, repelling potential predators.