District taxpayers will pay $64.5 million this year to cover the cost of numerous class-action lawsuits alleging that the city fails to provide such basic services as shelter for the homeless and care for the mentally ill, according to a report prepared for the mayor's Rivlin Commission.

Those lawsuits have a "staggering" impact on the running of two key agencies, the D.C. Department of Corrections and the Department of Human Services, said the report, released last week. It was prepared by two lawyers, Ann Meister and Jacqueline Helm, as a background paper for the Rivlin Commission.

Judges, as a result of some of these suits, now oversee huge portions of the D.C. taxpayer funds set aside for criminals and the needy. This represents a massive but little-discussed shift in responsibility from elected officials and bureaucrats to the judicial branch of government, legal experts said.

The 38-page report, whose authors used to work for the D.C. Council, is the first comprehensive look at the effect on the city of the 18 class-action lawsuits filed against the District since the early 1970s. It does not reflect the views of the commission, appointed by Mayor Marion Barry, but it is expected to influence the administration of Mayor-Elect Sharon Pratt Dixon in some areas. The commission was chaired by Alice Rivlin, a fellow at the Brookings Institution.

Most of the $64.5 million paid by the city this year still is used to pay for the city services in question. But it is not city officials calling the shots over these troubled programs -- it is judges.

This year, the report noted, the D.C. Corrections Department will spend 13 percent of its 1990 budget, or $31 million, on court-ordered prison construction and fines for disobeying court orders involving inmates. That money is earmarked to address issues raised in five class-action suits against the department filed on behalf of prisoners at D.C. Jail and the Lorton Correctional Complex in Fairfax County, alleging crowded, dirty and unsafe conditions.

Corrections Director Walter B. Ridley said that the day-to-day effect of the lawsuits is to cede control of a significant part of his budget to a non-elected federal judge -- in this case, U.S. District Judge June L. Green.

"I don't enjoy as a public administrator being controlled like that," Ridley said. "They've got a percentage of my budget that I might want to use in another manner. You don't like to have that kind of oversight."

"If . . . the courts come in and say, 'Hey, you have to spend more money on your prisons,' you have the courts making public policy," said former D.C. corporation counsel Frederick D. Cooke Jr.

Judges also have inserted themselves into the operations of the Department of Human Services in connection with the eight class-action lawsuits.

DHS Acting Director N. Anthony Calhoun said that when budget decisions are made by judges, "somebody else gets shortchanged." At his agency, he said, that is usually public health programs.

The report detailed the costs of the biggest case against the department -- the so-called Jerry M case, which challenges conditions for juvenile offenders at the Oak Hill facilities in Maryland.

This year, it will cost the District roughly $26.6 million to comply with court-ordered improvements in staffing and programs in the Jerry M case, the report said. While some of that money may have been spent by the District anyway, other costs represent pure losses to the taxpayer -- notably the $250,000 to $300,000 a year in lawyers' fees, it stated.

When the District does not comply with court orders, it often has to pay fines. The Jerry M case has so far resulted in $194,000 in fines. Still another $1.7 million in fines imposed in connection with the prison suits was inadvertently left out of the report, Meister said.

The report also noted "the human cost of noncompliance." While it offered no details, attorneys for the plaintiffs in these lawsuits say they range from beatings in crowded jail cells to mentally ill people wandering the streets because there is no outpatient clinic to give them needed medication.

The 18 class-action suits that the city has faced cover a variety of social issues, ranging from the racial makeup of the Fire Department to the number of nurses needed for mentally retarded people at the city's Forest Haven facility in Laurel. They have not come to an end like routine lawsuits, but result in consent decrees requiring continuing court oversight of a city agency or program.

"These consent decrees are basically forever," said Meister. "They mean the city will be involved in the court system for many, many, many years."

The report cautioned that assessing the true costs of those suits is difficult, since much of the money courts have ordered the District to pay as a result of them -- in housing the homeless, for instance -- would have been spent by the city in some form anyway.

But the lawsuits exact a huge cost to the taxpayers in other ways: legal fees, court fines and costs that the District may not have been prepared to make all at once, such as the $31 million it will spend this year building new prisons, the report said.

The report, besides pointing out the effects of consent decrees binding the city, also discussed inadequacies in the city's handling of a range of other legal matters, including its handling of the 3,066 routine lawsuits filed against the city last year.

The report said the District paid $12.9 million last year to settle routine personal injury lawsuits. That figure could be reduced significantly if the District stopped paying the awards out of a central budget run by the D.C. Corporation Counsel's Office and made the agencies found at fault pay them out of their own budgets, it said.

"The current system . . . disconnects agency actions from the consequences of those actions and provides no incentive for improved agency performance," the report said.

But other experts disagreed with the recommendation that routine settlements be paid out of agency budgets instead of a fund run by the Corporation Counsel.

"If agency officials have it come out of their budget, they'll never settle," said one federal judge with several such lawsuits pending in his court. The judge said that would lead to more trials and still more costs.

But the report said that having a better procedure for handling these cases would save the District money by establishing rules on how to settle claims and when to settle them at the least cost to taxpayers.

One example of how the system works now came in a recent federal court case in which eight Lorton inmates won $750,000 in damages from the District for beatings they suffered at the hands of prison guards in 1986.

One lawyer familiar with the case, who asked not to be quoted, said that lawyers for the plaintiffs at one point offered to settle the case for $65,000 -- less than one-tenth what the jury eventually gave them -- but that the Corporation Counsel's Office turned down the offer. The case is being appealed.

What's more, because understaffed and overworked Corporation Counsel lawyers are so busy defending the city in court, they have no time to file lawsuits of their own designed to generate revenue, such as seizing the property of convicted drug dealers, the report said.

Last year, it said, the District got $2.6 million from those kinds of revenue-generating lawsuits. This year, because there are no lawyers in the Corporation Counsel's Office to file them, that amount has dropped to $650,000.

Claude Bailey, a spokesman for the Corporation Counsel's Office, said, "We think they're pretty much on point in their analysis of the problems of this office."