The interplay of competition and predation often affects prey habitat use, which may concentrate prey in safer areas with indirect consequences on their foraging efficiency and the effects of their foraging on the community. Predation is intense on coral reefs where competition for limited space and food is severe. The sea urchin Diadema antillarum, an inhabitant of Caribbean coral reefs, uses crevice shelters and often aggregates with conspecifics for protection against predators, which appears to reflect a conflicting balance between group defense versus competition for limited shelter. A series of laboratory experiments was used to determine how the availability of shelter, conspecifics, and chemical odors from conspecifics and a predator—the spotted spiny lobster (Panulirus guttatus)—affect D. antillarum shelter use. The long-spined sea urchin D. antillarum responded strongly to the odor of conspecifics and the lobster predator. Absent the threat of predation, D. antillarum compete for shelter and avoid shelters bearing the scent of other urchins. But, D. antillarum readily shared shelters and preferred the scent of conspecifics when exposed to lobster odors. Thus, efforts to enhance the recovery of D. antillarum populations on degraded reefs must strike a balance between minimizing their mortality from predation and increasing habitat complexity, which not only increases shelter for D. antillarum, but also their predators.