On a warm afternoon in Harvard’s Arnold Arboretum, John DelRosso embarked on a task that was part detective work, part tough love, and reached for his chainsaw.

He was 40 feet up in a 137-year-old maple whose thin crown and dying branches attested to the fact that it had seen better days. DelRosso pruned away dead branches, then focused his attention on living wood, cutting branches that to the layman might seem fine, but to the chief arborist’s eye bore tiny holes that spoke of infestation.

But infestation with what?

An hour later, the branches were a mile away in Roslindale, safely sealed in a barrel, where they will stay for the next two years. Over that time, insects within the wood will develop, emerge, and fall into an attached liquid trap, where forest managers and scientists can collect and identify them.

The barrel is among 48 resting on racks in an otherwise unremarkable garage, next to stacked lumber, snowplows, and other off-season equipment for the Arboretum. It is part of a partnership between the Arboretum and the U.S. Forest Service that is unusual because it has put two organizations that typically fight forest pests into the business of rearing them.

By storing suspect branches and logs in closed containers, the program aims to take the guesswork out of identifying so-called “cryptic borers,” insects that do their damage hidden beneath the bark before emerging as a new generation of adults.

“At any opportunity, we take advantage of engaging, working, and collaborating with outside experts on the various factors that affect the health of our collections,” said Andrew Gapinski, the Arboretum’s manager of horticulture. “This partnership is one of many cooperative engagements, from soils to exotic pests, we are working to establish. We are continuously looking to adapt our management approaches through new information, to apply the most effective and sustainable methods to care for our collections.”

William “Ned” Friedman, Arnold Professor of Organismic and Evolutionary Biology, displays specimens collected from Arboretum trees. Kris Snibbe/Harvard Staff Photographer

The program serves multiple purposes, organizers said. The most obvious is to help managers understand the condition of their trees and decide on the best management strategy to address concerns. But the program also serves a broader scientific mission, identifying insect species moving into New England, and potentially through North America, for the first time and uncovering associations between existing species, such as the serviceberry branches that yielded bark beetles not previously linked to attacking it.

“We expect to find new host relationships,” said Mike Bohne, forest health group leader for the Forest Service in New York and New England. “Insects are shifting their range … The Southern pine beetle was never known to occur in New York and New England, and just in the past few years we found it infesting thousands of trees on Long Island, and we’ve trapped it throughout Massachusetts.”

The efforts can also point toward cures. Parasitic wasps, for example — whose larvae grow inside the destructive beetles, killing them — are sometimes found in the barrels. New knowledge of these parasitic associations can give managers added tools, like the option of rearing and releasing such wasps as bio-controls into areas where outbreaks occur.

The program was initially begun by the Forest Service in Washington, D.C., to augment traditional monitoring traps, which use an attractant. The drawback of those traps is that they are not effective in capturing all types of pests. Furthermore, traps may show what’s flying around in a forest, but can’t tell researchers which species and individual trees are infested. The Washington program, Bohne said, enlisted city residents to identify street trees infested with pests, which were then cut and reared in an effort to find out what was causing the decline.

Andrew Gapinski (left), manager of horticulture at the Arnold Arboretum, and John DelRosso identify pests that live hidden in wood. Kris Snibbe/Harvard Staff Photographer

Bohne cited the major advantages of working with a world-class arboretum. Its diversity of trees — the Arnold has 15,000 woody plants and more than 2,100 species from around the world — provides an opportunity to sample a huge diversity of plant material. Second is the presence of trained staff like DelRosso, who has been the Arnold’s head arborist for 16 years. Third is its recordkeeping, Bohne said. Trees at the Arboretum have “provenance,” and the history of most specimens is known. Arboretum records, for example, show that the tree DelRosso trimmed is a Rugel sugar maple in “poor” condition, supplied by C.G. Pringle of Charlotte, Vt., and planted into the living collection on Feb. 1, 1880.

“Using the arborists, they’re skilled, they know what to look for,” Bohne said. “Because the Arboretum has everything mapped so well, we know exactly where in the Arboretum it came from … It gives us a lot of information.”

The program expanded to the Arboretum in 2015 and is also being implemented at Green-Wood Cemetery in Brooklyn, N.Y. So far, Bohne said, Forest Service scientists have collected 1,496 beetles representing 102 species from the Arboretum’s drums.

Arboretum Director William “Ned” Friedman, the Arnold Professor of Organismic and Evolutionary Biology, said the importance of programs like this are only going to increase as the climate shifts and new pests arrive from elsewhere.

Recent history illustrates the importance of detecting outbreaks as quickly as possible, Friedman said. In 2008, the Asian long-horned beetle was discovered in Worcester, Mass., after it had already become well-established in the city’s maple trees. In an effort to protect the millions of maples in surrounding forests, wood from the area was quarantined. By 2015, 35,000 trees had been cut down and chipped.

The same beetle was discovered in trees near the Arboretum in 2010. That discovery led to imposition of a similar quarantine and the destruction of six infested trees. The quarantine was lifted in 2014, after no more infested trees were discovered.

“We could have lost the finest maple collection — some 65 species — in the world,” Friedman said. “One year later, it would have been a totally different story and a disaster. Once they’re out of the bottle — or more accurately, the wood — it’s essentially impossible to put them back in.”