PROVIDENCE, R.I. — Thousands of federal employees and their families are applying for unemployment and food stamps to get by as the longest government shutdown in U.S. history drags on with no end in sight. But for some of them, it has been an exercise in confusion and frustration.

Others, meanwhile, are hesitant to apply, knowing they will have to pay back the unemployment benefits when they finally return to work.

The U.S. Labor Department on Thursday reported that the number of furloughed federal employees seeking unemployment benefits has jumped, from fewer than 1,000 per week before the shutdown to more than 10,000 during the week that ended Jan. 5.

The nearly 4-week-old stalemate over President Trump’s demand for funding for a border wall affects about 800,000 employees. When it started, roughly 420,000 were told to work without being paid, and 380,000 others were sent home with no pay. Some of those numbers have shifted in the past week as agencies such as the IRS have called tens of thousands back to work.

Trump signed legislation Wednesday to guarantee employees will be given back pay once the shutdown ends. But that also means those who obtain unemployment benefits to get by in the meantime will have to repay the money.

The Labor Department has said that federal employees who aren’t working during the shutdown can collect unemployment, while those who are on the job without pay cannot.

But the rules are being applied unevenly. California, for example, is encouraging everyone affected by the shutdown to apply for unemployment, even those still on the job.

The rules made no sense to Charisma Banks, whose husband is deployed on a ship with the Coast Guard. The Chesapeake, Virginia, mother of a 9-year-old boy called the state unemployment office to ask whether her husband could qualify for benefits. She was told no.

“They’re like, ‘Here’s where it gets sticky: Even though he’s not getting a paycheck, he’s still employed,”‘ she said.

Banks, 34, has signed up her son for free lunch at school and applied for a grant from the American Legion. “I don’t even know how to go to food banks, but I had to learn this week,” she said.

Will Kohler, a furloughed, $38,000-a-year IRS tax examiner in Covington, Kentucky, applied for unemployment but ran into another kind of complication: His application is in limbo because the Treasury Department office that needs to verify his claim is closed as a result of the shutdown.

Kohler said many co-workers are in the same predicament. Not a single one has been approved for unemployment, he said. He said workers like him are stuck in a difficult position, in part because they are restricted by government ethics rules from getting many kinds of outside work.

“When it gets to a point where government employees have to go to a food bank, this is not the America that I grew up in,” he said. “It’s mind-boggling. It really is.”

Mick Devine, the New England vice president for the National Air Traffic Controllers Association, said some of his union’s members have been hesitant to apply for unemployment because they will just have to give it back.

Kathy Catanzaro, an administrator at the Rhode Island Department of Labor and Training, said she is seeing the same thing: “People are a little bit apprehensive about filing because they know they’ll have to pay it back once they’re paid and get back to work.”

An untold number of workers are also tapping other public assistance programs such as food stamps.

In Corpus Christi, Texas, Haley Hernandez, a stay-at-home mother of four and wife of an active-duty member of the Coast Guard, said she has applied for free lunches for her children, and she is awaiting an electronic food stamps card in the mail. She wonders how they will pay their $1,400 mortgage.

“This is a first for us,” Hernandez said. “Honestly, it’s pretty shameful, I feel, that any government employee would have to ask for food stamps or any kind of assistance like that. You would think that they would take better care of their service members.”