With little debate or public notice, Congress yesterday agreed to spend $22 billion to tighten up the 1988 thrift rescue deals the government made with investors, with the intention of saving money in the long run.

The cost of the 1988 deals, which have been widely criticized as giving overly generous terms to some of the country's wealthiest people, could be trimmed by about $4 billion over the course of the decade, regulators have said, if the government spends money now to restructure them.

There was widespread agreement in Congress that saving money was a good idea, but when it came to approving the money upfront to do it, few on Capitol Hill were interested in talking about it. Funds to modify the deals were tucked into an appropriations bill on housing and veterans affairs approved by voice vote in the House yesterday and in the Senate Thursday night.

"Nobody wants to touch this," said one House aide. But, he said, "It isn't as though there is any choice in the matter."

An amendment attached by Sen. Howard M. Metzenbaum (D-Ohio) requires that the agency overseeing the thrift industry cleanup, the Resolution Trust Corp. (RTC), examine each of the nearly 100 contracts to see if they can legally be broken due to fraud, misrepresentation or failure to live up to contract terms.

An analysis of the 1988 deals completed this fall by the RTC confirmed that they conveyed enormous financial benefits to savvy investors. Estimates of the cost of the deals have been rising steadily: Last year, the cost was placed at $40 billion; this fall, regulators put it at close to $75 billion.

The deals were agreed to by Reagan administration regulators who were short of cash and faced with having to pay off depositors at a growing number of failed thrifts. They used creative financing -- including government subsidies and tax breaks -- to get investors to take over troubled thrifts.

Among those benefiting from the subsidies and tax breaks were a number of the nation's wealthiest investors, including Revlon Group Inc. owner Ronald O. Perelman and billionaire Robert M. Bass.

It would be cheaper for the government to borrow funds and pay off investors now, instead of making yearly subsidy and interest payments. The prepayment of one promissory note alone -- at Bass's American Savings Bank of Stockton, Calif. -- could save the Treasury more than half a billion dollars, the RTC has concluded.

The $22 billion outlay to modify the deals in 1991 includes some money the government would have had to spend anyway on interest and subsidy payments. The amount that would be needed only for modifying the deals was put at $10.8 billion by Hill aides.

The expenditures will be reflected in the federal budget, but will be exempted from the deficit for purposes of calculating spending cuts under the Graham-Rudman-Hollings deficit reduction act.

Still up in the air yesterday was the fate of RTC's request for 1991 funds to close down the ever-mounting number of troubled thrifts. The House Banking Committee, which wants to conduct full-blown hearings on the RTC when it returns early next year, has okayed $10 billion in funds to cover thrift expenses through February.

The RTC has said it needs $11.3 billion to get through the first half of the fiscal year. RTC Chairman L. William Seidman, in a letter Thursday to the Senate Banking Committee, said he believes the $10 billion alone "will force the RTC to slow down {thrift} resolutions and thus will increase costs to the taxpayers."

Seidman and other RTC officials have said that delays in funding by Congress will cost taxpayers about $100 million a month, by forcing the agency to put off complicated closures of larger institutions.