Ecosystems are fundamentally connected to one another, although empirical documentation of the links between them, especially the links between marine and terrestrial ecosystems, has been limited. This study examined the foraging behavior and ecology of an understudied invertebrate, the hermit crab Coenobita compressus, which is remarkably abundant at the nexus of marine, terrestrial, and freshwater ecosystems. Data collected between 2008 and 2011 in the Osa Peninsula of Costa Rica revealed that C. compressus plays a generalist scavenger role across ecosystems. Beach almond fruits (Terminalia catappa) were a staple of the crabs’ diet, but the crabs also commonly consumed a variety of other fruit species and various parts of plants (nuts, seeds, flowers, husk, stems, buds) as well as algae, fungus, animal feces, and the carcasses of insects, jellyfish, conspecifics, other crustacean species, freshwater and saltwater fish, sea turtles (eggs and adults), and mammals. The crabs fed on these resources in prominent social aggregations, also forming such aggregations as they exchanged the aquatically derived gastropod shells that they use as homes while roaming the land. The size of the crabs’ aggregations around plant versus animal resources and around terrestrial versus aquatic resources did not differ, underscoring the species’ generalist foraging behavior. Broadly, these results suggest that C. compressus has one of the most diverse diets of any crustacean and plays a critical role in recycling organic matter and nutrients. This species might also mediate the passage of resources across different ecosystems, although further research is needed to explore this possibility.