Inmates at two San Francisco County Jail facilities are losing sleep over the Sheriff’s Department’s policies — literally.

Ten inmates, on behalf of the estimated 1,200 detainees at Jails Nos. 4 and 5, filed a class action lawsuit Monday against the Sheriff’s Department and city for longstanding practices that have allegedly deprived those inmates of sleep. Their attorney is Yolanda Huang.

The lawsuit, filed in U.S. District Court for the Northern District of California, alleges that sleep deprivation is a result of the department’s policies of serving inmates breakfast at 3:30 a.m., gratuitously disrupting inmates during mandated hourly safety checks, conducting medical appointments in the middle of the night, and leaving certain lights on.

“This ongoing, nightly sleep deprivation and disturbance has created a cascading negative effect on prisoners’ abilities to function at the cognitive, physical, and psychiatric levels,” the lawsuit states. “Cognitive impairment adversely impacts pretrial prisoners’ ability to assist in their legal defense.”

The lawsuit alleges that the practices have violated the inmates’ human and constitutional rights. They are suing to have the department’s policies changed, plus potential “compensatory damages” and attorney’s fees.

“What kind of people are we going to have if they’ve been put under this schedule for years?” asked Huang. “Would you be able to make a good decision if you’ve been going through that for five, six, seven years?”

Nancy Crowley, a spokeswoman with the Sheriff’s Department, said that those inmates filed grievances about the policies leading to a lack of sleep earlier this month. She provided Sheriff Vicki Hennessy’s response, sent on May 13, which explains the rationale behind the policies but also pledges that changes will be made.

Hennessy explained in her response that the 3:30 a.m. breakfast is in place to “assure that inmates arrive to their court appearances in a timely fashion.” She wrote that the hourly safety checks are “necessary to assure that no inmate is being victimized or attempting to hurt themselves,” and some lights remain on for the same reasons.

Regardless, Hennessy wrote that she ordered a “comprehensive review” of the current policies and is the process of drafting new ones, though nothing is yet final.

Monday’s lawsuit is yet another glimpse into the conditions at San Francisco’s jails, inmates’ mounting dissatisfaction with those conditions, and Hennessy’s attempts at remedying the issues.

In April, Hennessy called in the FBI to investigate a guard’s beating of an inmate — which has been an ongoing problem.

More than 100 inmates at 850 Bryant St. filed suit in March over raw sewage continually flooding over into their cells, a proceeding tied to a 2018 complaint about excrement, also helmed by Yolanda Huang.