Despite having months to prepare, City Hall failed to put in place a program that could give back to judges a powerful tool to keep tabs on potentially violent defendants released under the state’s new bail reform law.

The controversial law change removes the imposition of cash bail as an option for judges in most misdemeanors and other non-violent crimes.

But it also allows judges to order that those charged with felonies or in connection with domestic violence and sex-related cases be tracked with electronic ankle monitors to ensure they return to court.

Unlike the pre-bail reform rules, though, which left bail bondsmen in charge of the GPS monitoring, the new law mandates that only a governmental agency or non-profit can handle the placement and tracking of the devices.

The Mayor’s Office of Criminal Justice (MOCJ), meanwhile, failed to get such a program launched by Jan. 1, despite the measure being passed by the Albany legislature eight months earlier.

And MOCJ officials admitted Friday they still have no set timetable for when the system will come online — a ball drop that left Manhattan prosecutors and judges slack-jawed and disgusted.

“I feel sick,” said one Manhattan judge, who wished he still could require ankle bracelets for release. “I’m releasing defendants who are dangers to their community.”

Said a Manhattan prosecutor, “I think the legislature thought they were freeing poor minorities, but instead they handed a gift to a predominantly wealthy elite.”

It has even affected the highest-profile trial in New York — pushing the judge in the Harvey Weinstein rape trial to change the conditions of his release on Dec. 11.

Manhattan Supreme Court Justice James Burke removed the ankle requirement but hiked Weinstein’s bond to $2 million. Weinstein’s bail bondsman, Ira Judelson, however, made the pervy media mogul keep the tracker as a condition of his underwriting the sum.

The Post identified another four Manhattan felony criminal court cases where judges or prosecutors sought ankle monitors — only to be thwarted by City Hall delays.

In two cases, judges ordered that the defendants wear the trackers as soon as they become available.

Before bail reform, New York’s judges were allowed to require ankle monitors as a condition of release in high-profile and other cases where they worried about defendants fleeing despite posting bail.

The administration of the ankle monitors was left to the individual bail bondsman — who charge as much as $10,000 a year to the defendant for the service, said Judelson, the Weinstein bondman.

But the overhaul package passed last April required that the new electronic monitoring service be operated by a government agency or a not-for-profit, instead of the for-profit companies that traditionally provided the service.

Additionally, defendants will no longer pick up the cost of the monitoring service. Advocates pushed for that change following a New York Times/ProPublica investigation that exposed how the costs left defendants deep in debt.

The monitoring program delays were first reported by The City.

City Hall declined to provide a statement but said that officials are “moving ahead” with the program and that they are “seeking to roll this out on the fastest timeline possible.”

Additional reporting by Bernadette Hogan and Rich Calder