Prisoners locked in their cells for days on end report walls speckled with feces and blood. Birds have moved in, leaving droppings on the food trays and ice bags handed out to keep inmates cool. Blocked from visiting the law library, prisoners say they have missed court deadlines and jeopardized appeals. Unable to access toilet paper, one prisoner tore his clothing into patches to use for tissue.

One thousand inmates incarcerated at Waupun Correctional Institution, a maximum-security prison in southeast Wisconsin, have been confined mostly to their cells for more than four months, ever since prison officials locked down the facility and halted many programs and services.

More than two dozen inmates at Waupun, the state’s oldest prison, have revealed to The New York Times that since late March they have been forced to eat all meals in their cells, received no visits from friends or family, seen complaints of pain ignored and been allowed limited, if any, fresh air or recreation time.

The state’s Department of Corrections has offered little explanation about the lockdown or why it has lasted so long.

“There were multiple threats of disruption and assaultive behavior toward staff or other persons in our care, but there was not one specific incident that prompted the facility to go into modified movement,” said Kevin Hoffman, the department’s deputy director of communications. According to state data, nearly 100 assaults have occurred there in the past fiscal year.

Others familiar with the sprawling penitentiary suggest another reason for the restrictions: dire staffing shortages.

More than half of the prison’s 284 full-time positions for correctional officers and sergeants remain unfilled, state data shows. The shortages have severely hobbled the facility’s ability to operate safely, according to former wardens, correctional officers and members of Waupun prison’s community board.

“If I was the warden right now, I’d have that institution on lockdown, too,” said Mike Thurmer, who once ran the prison and now sits on its community relations board. “You can’t have a 40 or 50 percent vacancy rate and not have at the very minimum a modified lockdown.”

What is happening in Waupun illustrates a reality at prisons across the country: Lockdowns, once a rare action taken in a crisis, are becoming a common way to deal with chronic staffing and budget shortages.

Critics say these shutdowns became easier to justify during the pandemic, when prison officials could cite the need to control the spread of the Covid. But even as most Covid-related restrictions have been lifted, lockdowns continue to be applied.

“They are using it at the drop of a hat because it makes day to day operations easier,” said Tammie Gregg, deputy director for the A.C.L.U.’s National Prison Project.

Waupun is not the state’s only prison where inmates are locked down. Eighty miles northeast, those at the maximum-security prison in Green Bay have been effectively locked down since June. Inmate advocates have shared reports of prisoners protesting conditions inside the institution, but the Department of Corrections would confirm only that there were unspecified security threats.

Green Bay’s prison has a vacancy rate for correctional officers and sergeants of 40 percent.

State prisons across the country have been denying inmates showers, exercise and timely medical care. In Mississippi, North Carolina and Texas, thousands of people have been kept in their cells as officials scrambled to hire more officers.

Last year, a former lawmaker and director of an association that represents prison workers in Oklahoma said staffing shortages had led to increased violence and repeated lockdowns.

And in the federal prison system, which is also suffering severe labor shortages, officials in recent years have turned to nurses, teachers and cooks to guard inmates as nearly one-third of correctional officer jobs sat vacant. Staffing shortages led one prison in Texas to lock inmates in their cells on the weekends.

The practice extends to jails, where offenders typically await trial or serve sentences shorter than a year. In 2022, inmates at one Pennsylvania jail were placed on lockdown after officials called a state of emergency because of low staffing levels. More recently, officers at Prince County jail in Maryland said a shortage of guards resulted in frequent lockdowns and forced overtime for officers.

Given the staffing shortages, some prison officials in Wisconsin and elsewhere said their facilities would be impossible to manage without lockdowns.

But studies show there may be more at stake. A survey of inmates across 19 prisons in the United Kingdom found that 84 percent of those who responded from higher-security prisons said their mental health had deteriorated over the course of lockdowns during Covid outbreaks because of boredom, anxiety and limited social interactions.

Lockdowns often also restrict family visits, as they have in Waupun, which research has long shown can negatively affect the likelihood of successful reintegration after an inmate is released.

Ms. Gregg said parallels can be drawn between lockdowns and solitary confinement, which can lead to long-term psychological damage. Limited access to libraries, a loss of educational opportunities and a denial of substance abuse treatment — all of which frequently result from lockdowns — can mean the punishment prisoners already experience is compounded.

With its 53 percent staff vacancy rate, Waupun is the most short-staffed facility in a chronically understaffed state prison system. Supplemental correctional officers come in on a rotating, two-week basis to provide relief for full-time staff, but the help may not go far enough.

The lockdown at Waupun has led to delays in medical care and psychological services. Multiple inmates said prisoners were cutting themselves or threatening self-harm simply to get medical attention. And even then, they said, assistance was slow to arrive — if it came at all.

Inmates at the maximum-security prison have been convicted of felonies ranging from drug possession to burglary to murder. The Times interviewed prisoners by phone and email.

“People are threatening suicide every day, and there’s no treatment here,” said a Waupun inmate, Jayvon Flemming, referring to mental health care. “You have to harm yourself or threaten suicide just to get staff’s attention. I’m in a nightmare.”

“I’ve attempted suicide four times in the past months just because of this lockdown and not being able to go outside to get sunlight,” said another inmate, Ashton Dreiling.

“We’ve received no indication that this is the case,” Mr. Hoffman, the Department of Corrections spokesman, said when told of allegations that inmates were threatening suicide or self-harm more often since the lockdown began.

Wisconsin prisons also face a shortage of staff for health care (24 percent) and psychological services (27 percent), according to data from the Department of Corrections. One Waupun inmate, Kevin Burkes, has been living with pain and blurry vision — a possible complication, medical records indicate, of an autoimmune disorder. In June, he submitted a request to see a doctor but received a reply that read, “No optical during lockdown.”

Mr. Hoffman acknowledged that early on, appointments were limited to those deemed necessary by medical professionals. Routine appointments are now allowed more frequently, he said.

Lonnie Story, a civil rights attorney based in Florida, agreed in August to represent Waupun inmates in a class-action lawsuit against the state.

Mr. Story said their complaints have been notably consistent. “What’s setting off legal alerts and red flags in my mind are the medical aspects — complaints about the ventilation system, the denial of medical treatment and the denial of psychological evaluations or treatment,” he said.

The exact number of lockdowns that occur in federal and state prisons is not clear, because there is no national tracking system. There are no standards for how lockdowns are implemented or how long they can last, Ms. Gregg said, and there is little oversight for the practice.

The Wisconsin Department of Corrections cannot say whether the lockdown at Waupun is the state’s longest, because it does not formally record the numbers. But those familiar with the state’s prison system said lockdowns typically last just days or weeks, not months.

In April, Senator Jon Ossoff, Democrat of Georgia, introduced a bipartisan bill in Congress, the Federal Prison Oversight Act, which would require the Department of Justice’s inspector general to review the 122 correctional facilities within the Bureau of Prisons and assess the frequency and duration of lockdowns.

The office of Gov. Tony Evers, a Democrat, whose administration oversees Wisconsin’s Department of Corrections, told The Times that ensuring prison safety is a top priority and that his office will continue to rely on the D.O.C.’s judgment. The governor’s office did not respond to questions about the cause of the restrictions or steps it might take if the lockdown continued.

Sean Daley, a representative for AFSCME, the union that serves as an advocate for Wisconsin prison guards, said he would not be shocked if staff shortages were at least partly to blame for the lockdown at Waupun.

“The system is breaking, if it’s not broken yet,” Daley said. “And Waupun can be a glaring example of that under its current state.”

Lawmakers hope an increase in pay will improve recruitment and retention, although hiring enough new staffers to provide relief may take months. The state Legislature agreed to raise starting pay for correctional officers to $33 an hour from $20.29 an hour and made additional money available for those working at maximum-security prisons and facilities with vacancy rates above 40 percent.

But Mike Thomas, a former correctional officer who worked at Waupun’s prison for seven years before he retired as a captain, said the pay increase was only one piece of the puzzle.

Dangerous conditions, forced overtime and lack of time off contributes to high burnout rates among correctional officers. Mr. Thomas recalls working 75 days straight, many of them double shifts. It was so difficult to plan for days off, he said, that many resorted to calling in sick when they needed a personal day.

Since mid-2012, Waupun has seen 440 assaults on staff. At least 95 occurred this fiscal year — more than any other Wisconsin prison and nearly double the number of the next closest facility, according to D.O.C. data. When adjusted for the prison population, Waupun’s incident rate in fiscal year 2023 is the third highest and seven times the state average.

In testimony sent to state lawmakers in January, Brian Wackett, a correctional officer, described an urgent need for pay raises to attract and retain more officers.

Waupun prison had a night last year, he said, when they only had eight staff members working inside the prison. “They have 900 inmates there, and no one can adequately supervise them all at a given time,” he said.

Many inmate jobs inside the prison have been put on hold. In-person college classes for prisoners, offered by Trinity International University, were paused at the end of March, according to a representative from the college.

Policies that say prison staff must offer inmates showers at least twice a week, as well as four hours of recreation outside of their cells, have been suspended during the lockdown.

The D.O.C. said recreation is still offered but that the frequency and duration were dependent on staffing levels. Some inmates claimed they received one hour a week of exercise. Others said recreation was offered inconsistently, and often canceled if prisoners broke minor rules, like not standing up for morning head count.

In addition to the loss of educational opportunities, inmates like Chase Burns said they were denied visits to the law library, a right guaranteed by the Supreme Court. The D.O.C. said inmates can still request materials from the library. But multiple prisoners report those requests are delayed until a librarian can fulfill the search, making it difficult to file documents by court deadlines.

Days after responding to questions from The Times, the prison began allowing library visitation for those with a court date within 45 days.

Mr. Flemming, the Waupun inmate who described how prisoners were threatening suicide to get medical attention, said his biggest fear was not being able to summon help in a medical crisis.

He said he recently had trouble breathing and requested immediate assistance, but it took four days for a nurse to see him. When she came, he said, she charged him $7.50 for a medical co-pay, took his vital signs and told him he was on a list to be seen by a doctor. His breathing problems continued.

“There’s no ventilation in these cells,” he said, adding that there was no way to call out to staff in a medical emergency. “We shouldn’t have to live like this.”

Jamie Kelter Davis and Justin Mayo contributed reporting.

This article was reported in partnership with Big Local News and Wisconsin Watch and with support from the Data-Driven Reporting Project.