Philip Dunn, Alastair Farley, and Zechariah Moore are hunting for "a wooden box that helps blow up rocks." Alastair reads the clue out loud—and the three eight-year-old boys must collaborate to find their quarry in the maze of exhibits at the New York Transit Museum.

"Ooh, I know where it is," yells Philip, "Me and Zechariah will lead the way."

A visit here will evoke almost anyone's inner train enthusiast—even if you didn't know you had one. You enter by descending into a former station entrance in Brooklyn and are soon surrounded by the mundane talismans of over a century of city commutes, now slightly decontextualized in the peculiar light of the familiar low-ceilinged tunnels.

You can walk through turnstiles and elicit their oddly satisfying clanks, play with the knobs on old token machines, and even wander into the usually forbidden areas of decommissioned trains, like the conductor's booth. It feels like finding Platform 9 ¾.

"My favorite train is the M train because it's awesome."

But for these boys, some visits are especially magical. The second and third graders are participating in the museum's Subway Sleuths program, a series of ten after-school classes designed to help children on the autism spectrum connect through their love of trains. (Fourth and fifth graders can also participate, though they attend on separate days.) Fees for the program run on a sliding scale so children from all backgrounds can participate.

Autism is a neurological condition that involves difficulties with social communication, repetitive behavior, and sensory differences like over-sensitivities to noise, lights, and smells—or reduced sensitivities. Autistic people tend to like routines and regularities and they often develop passionate interests in particular subjects, especially those that involve mechanical, musical, or mathematical systems.

"Trains are a specific example of a system, in this case a mechanical system," says Simon Baron-Cohen, professor of developmental psychopathology and director of the Autism Research Centre at Cambridge University in England. Baron-Cohen pioneered a theory about autism, which suggests that autistic people have more space in their brains devoted to focusing on systems of objects or ideas ("systemizing") and less aimed at understanding relationships and social cues ("empathizing"). This imbalance makes it hard for children with autism to make friends.

Zechariah Moore playing with a model train at the New York Transit Museum. Ramy Zabarah

Baron-Cohen has found that autism is more likely to run in families that include engineers, computer scientists, and mathematicians and many people in those professions have high levels of autistic traits, even if they don't reach the level needed for a diagnosis.

Trains are a particularly common autistic special interest. "Compared to other vehicles, they have fewer 'degrees of freedom' because they can only move along tracks," says Baron-Cohen, "Cars and planes are more animate in their form of motion, moving at the whim of the driver, but trains are much easier to predict." Research shows that autistic kids are less attuned to biological motion than typical children, attending more to how objects move than to the social information in human posture and gesture.

Baron-Cohen adds, "People with autism have a preference for predictable, systematic information. Joining a program for young train enthusiasts thus plays to their strengths—in understanding systems—but embedding this in a social format."

Philip Dunn interacts with the other 'Sleuths' Ramy Zabarah

When the three sleuths arrive, their enthusiasm is obvious. "He practically skips down the stairs when we go to Subway Sleuths," says Andrew Dunn, Philip's father. To contain the participants' exuberant energy, Liza Trinkle, a speech and language pathologist; Veronica Pastore a special educator; and Meredith Martin, the special education and access coordinator for the museum, who is in charge of the program, have a strict schedule. It is displayed on a poster, to which a paper model train is affixed with Velcro. One boy gets to move it to the next stop as they go from one activity to another. While predictable structure helps nearly all kids manage the whirlwind of change that is childhood, it is especially important for children on the autism spectrum.

Even the way the boys move from room to room involves trains: they line up and pretend to be either an express or local train, with Zechariah, a buoyant boy wearing a Ninja Turtles T-shirt, as the conductor this time. "My favorite train is the M train because it's awesome," he says.

The activities begin with each child and teacher doing a "train dance," in part, a way to help the boys discharge their excess energy before they need to focus. Philip, who is blonde and wiry, improvises a "G train" dance, jumping up and down with his feet pointed forward. All of the kids and adults then copy the dance: another aim of the exercise is to get the children to attend to social motion and signals and learn to read and reciprocate them.

Alastair Farley leads the team in following clues. Ramy Zabarah

Started in 2010, the idea for Subway Sleuths came from Marcia Ely, at the time, the museum's assistant director, who noticed how popular the museum was with both autistic adults and children. While some autistic people are nonverbal, this program is geared toward kids in the second through fifth grade who have language skills, but have difficulty using them to connect with peers. Martin hopes to expand it to older youth eventually.

With input from autism specialists, Subway Sleuths was designed to use the kids' existing interest in trains to help them make friends. Often, their obsessive focus alienates their classmates—but here, it is a common interest. "We're giving them the opportunity to share their passion and feel like their passion is acknowledged," says Martin.

"He practically skips down the stairs when we go to Subway Sleuths."

A common misconception about autism is that autistic people lack concern for others or just don't want to engage socially. Often, however, they do want to connect, but are overwhelmed or distracted by sensory experiences or respond inappropriately because they misread cues.

Andrew Dunn thinks the program has helped his son, although he says wryly, "there's no control group, so it's hard to know if he's just growing up."

"I've seen him do quite compassionate things," he adds, describing an incident when the group had to walk through an old train, where there was an ad with the image of a scary clown that usually disturbed one of the boys. "Philip said, 'I'll hold your hand when you go through that car,' says Andrew, adding "Kids like Phil don't always express emotion in ways that you and I might recognize, so it was good to see that."

Ramy Zabarah

When the boys find the room with the "box that blows up rocks," they circle the wooden detonator, which looks like it comes straight out of a Wile E. Coyote cartoon. Pressing down on the T-shaped plunger—once used to set off dynamite to excavate subway tunnels—results in a satisfyingly explosive sound.

"I love it here," says Philip.