The shift from hunting and gathering to farming altered human evolution—and that of our closest companions, dogs. Coprolites, or fossilized poop, are a “phenomenal” source of information on how diet influenced such changes, says University of Oxford archaeologist Greger Larson. “They’re snapshots of somebody’s gut.” A recent analysis of 13 Bronze Age canine coprolites reveals how shifts to a grain-based diet affected dogs’ gut microbes, which may have played a role in the animals’ domestication.

Researchers sequenced DNA from the 3,600- to 3,450-year-old fossils, which were found at the site of an ancient agricultural community in northeastern Italy. Dog DNA in the coprolites had fewer copies of a gene that encodes amylase, a digestive protein that breaks down starches in the gut, than that of most modern dogs. Many of today’s wolves lack this gene altogether, and scientists typically attribute the divergence to domesticated dogs’ shift from meat-heavy to grain-rich meals.

But along with an animal’s own proteins, gut microbes also aid digestion. When the researchers sequenced microbial remnants in the fossilized feces, they found evidence of bacteria that produce high amounts of amylase. The dogs’ own genomes had not yet fully evolved to handle the grainy diet of their farming domesticators, “so they were complemented by microbes,” says University of Bologna microbiologist Marco Candela, senior author on the study, which was published in iScience.

Although these fossilized microbiomes shed light on an intermediate stage between wolves and dogs, domestication was not a simple linear process, says Durham University zooarchaeologist Angela Perri, who was not involved with the study. “It feels neat and clean to say it’s a progression from X to Y to Z,” she says, but consistent interbreeding between wild and domesticated canines complicates things. And even modern dogs carry varying numbers of amylase genes, notes Larson, who also was not on the research team. Still, Perri says it is significant that microbes may have picked up the slack where the dogs’ own genomes fell short. This phenomenon might have also occurred in human guts during our shift from a hunter-gatherer diet to a farming one—a possibility Candela and his colleagues are now examining.

Perri notes that the new research demonstrates how much can be learned from fossilized animal excrement, a historically untapped and underappreciated resource from human settlements. “Usually in archaeology, human material is difficult to get a hold of,” she says. “But no one is fighting over dog poop.”