The eight wrongdoers sat inside a windowless basement classroom, serving a court-ordered penance for their transgressions. For the next 90 minutes, they would learn about the proper rules of the road, how to use hand signals and when to change lanes safely — even if most did not believe they had done anything wrong.

“He said I wasn’t in the bike lane,” said Kenny McKissick, a 32-year-old messenger. “But I was on the line.”

This spring, the Midtown Community Court began sentencing cyclists who had been issued tickets for certain offenses in and around Midtown Manhattan to a class to learn about bicycles and traffic.

Think remedial driver’s education — for bike riders.

“You couldn’t possibly ticket all of the stuff you see irresponsible cyclists do,” said Judge Felicia Mennin, who worked with the nonprofit organization Bike New York to develop the new sentencing option.