On the coldest morning New York City has seen this winter, a stream of teenage students hit a bottleneck at the front of a Brooklyn school building. They shed their jackets, gloves and belts, shivering as they wait to pass through a metal detector and send their backpacks through an x-ray machine. School safety agents stand nearby, poised to step in if the alarm bleats.

It’s an everyday occurrence for more than 100,000 middle and high school students across the city.

On this morning, as on every school day, senior Justin Feldeo prepares to be pulled aside for separate screening by a hand wand. Feldeo is studying to be a firefighter and the boots he wears for class trigger the metal detectors.

Fifteen minutes after the formal start of the school day, students are still pouring in, even later for having to go through the machines.

Almost as many New York City students run the gauntlet of x-ray machines each day as pass through the scanners at busy Miami International Airport. And the procedure is numbingly similar. Students must remove belts, shoes, and sometimes bobby pins as the wait stretches as long as an hour.

A ProPublica survey found that the daily ritual is borne disproportionately by students of color; black and Hispanic students in high school are nearly three times more likely to walk through a metal detector than their white counterparts.

Nearly 21 years after a fearful city installed them at the front doors of more than 80 schools, there are growing questions about whether the security precautions do more harm than good. Today, by ProPublica and WNYC’s count, students at more than 236 New York City schools are required to pass through metal detectors.

“There are a lot of things that are done in the name of student safety that don’t view the students as the people who need to be protected, but view the students as the people somebody else needs to be protected from,” said Jill Bloomberg, principal of Park Slope Collegiate, a secondary school with 423 students in grades 6 through 12. She is trying to get the scanners removed from her building in Brooklyn.

The metal detectors were first installed in the early 1990s when crime rates were much higher and have stayed in place even as crime in the public schools has fallen 48 percent over the past 10 years. Crime in schools in the last year alone has fallen 11 percent, according to the New York Police Department.

Since 1998, only two permanent metal detectors have been removed. And their necessity appears almost never re-evaluated: The scanners have remained after the schools in which they were installed shut down and entirely new schools opened in the same buildings.

And while some principals say the security measures provide a critical line of defense at schools with particularly volatile mixes of students, few believe more than 200 New York City schools still meet this bar.

In a report called “Security With Dignity,” a task force created by New York Mayor Bill de Blasio recommended last July that the city remove some metal detectors. The NYPD agreed to study the issue, but has provided no timeline. And nearly six months later, the Department of Education has yet to publicize criteria for removing them.

A spokeswoman for the Department of Education would not comment on a plan for removing the metal detectors. “We will continue to ensure students are in safe environments where they can learn and succeed,” said Toya Holness, a deputy press secretary.

The recommendations have faced stiff opposition from the union which represents the New York City school district’s over 5,000 safety agents, who are technically part of the NYPD.

“‘Security with dignity,’” said Greg Floyd, the head of Teamsters Local 237. “I don’t know how you have the two in the same sentence.”

Floyd said the metal detectors are working as an effective deterrent and warned that the task force should be wary about cheering their removal. “In this case, they better very well hope they work, because if they don’t, then they all have problems,” he said.

And Floyd brushed aside the complaints that the scanners are used primarily in schools serving low-income black and Hispanic students. Children from those neighborhoods, he said, often require them.

“Would I say, put metal detectors in Brooklyn Tech? I would not,” Floyd said, because the students there, “some from affluent neighborhoods,” are “committed to learning, they’re not committed to fighting. That’s not the case in every New York City public school, and you can’t say, ‘Treat the children the same’ because we don’t do that.”

Despite the widespread use of the scanners, the amount of contraband found is low. In the approximately three million scans conducted in the first two months of this school year, only a tiny number of contraband items were discovered, according to a NYPD document obtained by ProPublica. Among the 126 possible weapons seized at schools that scan daily — some found hidden on school grounds, others by scanners — were an unloaded handgun, 73 knives, 21 boxcutters, three BB guns and an assortment of loose bullets and razor blades.

Some school officials believe the daily security checks actually lead to behavior problems among the students. Until recently, Tyler Brewster was a dean of discipline and a math teacher at the School for Democracy and Leadership in Brooklyn, which has metal detectors. She now works at The James Baldwin High School in Manhattan, which does not. Brewster said she doesn’t believe students at either school should be forced to go through the scanners, and that it brands whole groups of students as untrustworthy.

“We didn’t have to go through the metal detectors as teachers, and I’m no less or more human than our students. Why do you trust me to have a bad day and handle it the right way versus the kid having the bad day?” Brewster said. “I wonder how much of the tone is set by having metal detectors in the first place.”

Kamaya Sanders, a student at the Secondary School for Journalism in Brooklyn, said that she sometimes felt suspicious of her fellow students as they stood in line to get checked.

“Sometimes you want to say your school’s safe, but you have the metal detectors, so you never know. Then let’s say someone in front of you gets stopped, then you’re like, ‘Oh, they may have something.’ You get scared,” Sanders said. “It does make you feel safe in a way, but sometimes it’s not worth it.”

At Democracy and Leadership, Brewster said, the scanning led to daily altercations, some of which have ended with arrests.

“There were maybe 3,000 students in my building and every single person had to be scanned,” she said. “On rainy days, the kids were gonna have to wait in line. In some cases, they had to take their shoes off, but the floors were wet so then there would be an argument between the safety agents about not taking their shoes off, and then not being allowed into the building and then that would escalate.”

One of two metal detectors at the main entrance of the John Jay building. (Cecilia Reyes/ProPublica)

The dilemma of the scanners is on display at a massive brick building in the heart of Park Slope in Brooklyn. The building, which takes up an entire city block, once housed a single high school, John Jay, with a tumultuous reputation. Now four new schools share the building. One of the schools, Park Slope Collegiate, would like to remove the metal detectors, the others don’t.

Bloomberg, Collegiate’s principal, said the neighborhood, which is now filled with trendy shops and restaurants, has changed significantly and that fights or weapons in the building are now rare.

For reasons the NYPD did not explain, the John Jay campus was not among the school sites listed as having a metal detector, so it was unclear if any weapons had been recovered from the building in the first two months of the school year.

The metal detectors send a message to the students that “we don’t trust you. And even if we trusted you, we don’t necessarily trust the guy behind you.” That message, she said, runs counter to what her school is trying to teach and “it’s alienating.”

Bloomberg said she has been against the metal detectors since she became principal at the school a dozen years ago. She said her colleagues, the principals at the other schools, are worried that something could happen if the metal detectors are removed.

“It’s very hard to have a rational conversation when you’re talking about the possibility of something happening,” Bloomberg said. “They make a lot of people feel safe: it doesn’t mean they make them safe and it doesn’t mean that they’ve considered what they give up.”

The story of how New York City came to install metal detectors at middle and high schools across the city traces to a February morning in 1992.

It wasn’t even 10 a.m. before two students were shot to death at Thomas Jefferson High School in the East New York section of Brooklyn. By the afternoon, a third teen had died after accidentally shooting himself in his house.

That day, everything that could have gone wrong did. Then-Mayor David Dinkins had been scheduled to address the Jefferson students as a preventive measure after a separate shooting at the school killed a 16-year-old boy two months earlier. After that shooting, the school began performing security scans on students with hand-held devices. But on the day of the mayor’s visit, principal Carol Burt-Beck called off the scans, convinced they would send the wrong message to students. Fifteen security guards and police officers were present in the school. That morning, gunfire erupted just a few feet away from them.

The city was quick to respond. The Board of Education approved a $20-million plan to install metal detectors, x-rays and electromagnetic doors at an additional 40 schools, vastly expanding a program that had involved just 16 schools, usually large and in the most crime-ridden areas of the city.

In the years that followed, the installation of metal detectors became the answer to every new slashing or stabbing. Twenty more schools added them in 1993, bringing the total to 81.

The rise in serious incidents at the city’s schools in the 1990s ran counter to the city’s dropping crime rate. Over the 1991 school year, 3,193 weapons were confiscated in public schools, 189 of them firearms. The following year, violent incidents in schools rose 16 percent to 5,761.

Dinkins, up for re-election against Rudy Giuliani, who was campaigning on a “tough on crime” platform, put police officers in all of the city’s then 1,069 schools where they have remained ever since.

Over the next three years the city steadily added metal detectors to its schools. By 2003, 88 middle schools and high schools had them. Some of these schools have since been replaced by multiple smaller schools, yet the scanners remain.

Thus far, none of these schools has removed the metal detectors outright and the current plan includes a gradual reduction in use. NYPD Assistant Chief Brian Conroy, of the School Safety Division, said the police can reduce scanning in a school to three or two days, then even further to random scanning.

One Bronx building, called JHS 113 Richard R. Green, that houses four middle schools, has already reduced its scanning, so far without ill effects, according to an assistant principal at one of the schools.

“The chancellor came to the building in the fall, and noticed it was a pretty calm place,” said Dr. Marvin Jennings, assistant principal at The Forward School. “Kids were in classrooms. Teachers were teaching. Learning was happening. It added to the feeling and sentiment that daily scanning was not necessary, and could be scaled back.”

The Forward School is emerging from a rocky past. Since 2012, it has been labelled a “persistently dangerous’’ school by state officials and has had four different principals in five years. But Jennings said the environment has improved and that kids feel safer in the school even with less scanning. The NYPD data obtained by ProPublica notes only two items found on site during the first two months of the school year, a knife and a “tool” found in a flowerpot outside the school.

For Jennings, what matters most is the students’ mindset as they go through the detectors.

“It won’t be the first time they get scanned, it won’t be the first time that someone looks at them in a way that’s less than complimentary” because of race, gender or ethnicity, he said. “Helping them learn how to cope with that, and seeing themselves as bigger than the opinion of another man or woman is what I think gets them through.”

One of the few school buildings that has managed to remove the scanners, the former Eastern District High School in Brooklyn, did so by enlisting students in the effort to quell violence. In 2006, the high school was on its way to be shut down and replaced by three smaller schools in the same building. The three new principals joined forces with elected local officials, parents and persuaded the Board of Education to remove the machines.

“We came in as wide-eyed, idealistic, newbies, and we wanted to change things,” said William Jusino, principal of Progress High School, one of the schools that moved into the building. Eastern District, he said, used to have such a bad reputation as a “dumping ground for difficult children and staff” that local shops would close down when school got out only to reopen later. “We wanted to make sure that we avoided that,” Jusino said. “That we didn’t grow into that type of situation.”

Jusino and the other principals took a stance that the metal detectors had to go even though everyone was “never 100 percent sure it was a good idea.” District officials gave the new schools their chance to rethink school safety.

For the first two years, Jusino recalled, students were reminded on a daily basis: They were being trusted to not bring in weapons into the schools.

“We’ve been on high alert ever since,” Jusino said, “You’ve gotta make sure that there isn’t a serious incident, god forbid, and how could you make sure? How could you guarantee that? You really can’t. What you could do is invest in your children.”

The most serious challenge to the scanner-less approach came last January when two Progress High School students were shot in connection with gang activity a few blocks from the school. Deans ushered kids inside and pop-up metal detectors were stationed in the building.

“Folks were genuinely afraid and anxious, and I understood it. I’m anxious every day,” Jusino said, recalling a emergency staff meeting at which several faculty members expressed their desire to have metal detectors back. “But the answer is not the machines, the answer’s the relationships. The answer’s giving kids options in the school.”

“Weapons will get into the building without metal detectors. Weapons will get into a building with metal detectors,” Jusino said. “The idea is ‘What do you do. What programs do you do. What’s the trust and values you have in your school.’”