Former New York police Commissioner William J. Bratton yesterday slammed President-elect Trump’s plans for a Muslim registry as an “idea (that) doesn’t work,” just days after the incoming commander in chief publicly stood by the plan in the wake of the latest terrorist attack.

“That idea doesn’t work. It never did and it never would,” Bratton told the Herald outside a South Boston eatery, where he gathered with friends for an annual holiday lunch.

Bratton in 2014 shut down a secret surveillance program his predecessor, Raymond Kelly, had launched targeting Muslim citizens, though the idea got new life from New York U.S. Rep. Peter King, who said he discussed the program with Trump.

“New York City has a half-million Muslim residents. More than a thousand members of the departments are Muslim,” Bratton said. “Very loyal Americans. We don’t want to go back to the days where we single out somebody because of their race or their ethnic background.”

Bratton, who retired from the New York force in September, made headlines over the summer when he said a potential Trump presidency “scares the hell out” of him. But as Trump tweeted about the United States’ nuclear capabilities and a recent terrorist attack in Berlin, Bratton — once Boston’s top cop — said overall he’s going to “wait and see how the new presidency shapes up.”

Since his retirement, Bratton has returned to the private sector, where he’s running a newly created risk division at the global advisory firm, Teneo Holdings.

Still based in New York, he focuses largely on cybersecurity and anti-terrorism, while working with the heads of Fortune 500 companies.