Shaken by rising welfare costs, this capital of the nation's wealthiest state has adopted a 19th-century solution to a 20th-century recession.

It has revived the poorhouse.

Since October, Sacramento County has cut off all cash grants and food stamps to single, employable adults now applying for general-assistance welfare. Instead, they have been offered room and board in a dormitory-like shelter, a solution that has spawned a lawsuit and led many not to apply for welfare at all.

The Bannon Street emergency shelter, a brown, single-story, unmarked building in an industrial part of north Sacramento, is the first poorhouse established in California in half a century, and apparently the only county poorhouse in the country. The 50 to 60 men and women who live and eat here each day receive no cash from the county and must work at least seven days a month cleaning drains or cutting grass to earn the right to remain.

"I think it's no good," said Alfonzo Collins, 46, a nurse's aide. "They tell you where to go, they tell you where to live, they tell you what to eat . . . . We get no privacy."

But Sacramento County officials say they are satisfied with the program. It has saved the county money: in November, 1981, 552 single, employable persons began to receive cash grants, usually a bit less than $200 a month. In November, 1982, shortly after the Bannon Street shelter program began, only 76 single, employable persons received permission to live at Bannon Street, in what the county refers to as "aid-in-kind" general assistance.

Many others, residents and welfare case workers say, decided not to apply after they heard they would have to live there.

Harry Specht, dean of the school of social welfare at the University of California at Berkeley, called the revival of the poorhouse a "medieval" attempt to "create a stigmatized population" and discourage people from applying for welfare at all.

Rex Rapier, who directs the shelter under a $9,800-a-month contract given to his Christian service organization, the Volunteers of America, considers the shelter a humane way to meet the mounting welfare needs of American cities.

Meals at the shelter are served on a rigid schedule, starting at 6:30 a.m. A resident must appear at a 9-p.m. bed check unless he has notified the shelter staff he will be absent, or he risks losing his bed. The shelter also provides regular prayer meetings, Sunday religious services and Alcoholics Anonymous meetings. Liquor and drugs are forbidden and smoking is not allowed in the dormitories.

Unlike state and federal aid to families, the disabled and the aged, general assistance in California and other states is supported completely by local taxes. Lilly Frawley, deputy county counsel, said Sacramento County was forced to cut out cash grants for general assistance in part because federal welfare grants to the states had been cut.

Persons who are unable to work, married couples and those on general assistance before the shelter system began still receive cash grants and food stamps.

Last fall, a seasonal farm worker, Arthur Robbins, 44, checked in with county welfare officials, assuming he could apply for general assistance until his expected unemployment checks began to arrive. When told he had to go to the shelter, he instead sought out lawyer Jeff Ogata.

With the help of the Western Center on Law and Poverty, Ogata, of Legal Services for Northern California, filed suit against the shelter system as being discriminatory and a violation of the constitutional rights to privacy and freedom to travel. A hearing is set for April.