Rosemary Hegarty, having seen a horror movie before, knew enough to avoid the dark furnace closet.

So she braced a two-by-four across the door, dialed 911 and waited.

“He was thrashing around down there. I heard him cursing,” said Hegarty, who lives alone in El Sobrante. The dispatcher sounded sympathetic: “I’m sorry ma’am. They’re on another call.”

Twenty-two minutes later, Contra Costa sheriff’s deputies arrived. One surmised a trapped raccoon, but at 1:37 a.m., they extracted a man carrying a 30-inch machete from the closet.

“I was pissed a little,” not to mention terrified, during that June 9 encounter, Hegarty said. “But mostly I want people to know how much we are on our own at night. I didn’t know.”

The deputies apologized — one of their cars had broken down. And that one breakdown, late at night, crippled the county’s largest law enforcement agency.

The sheriff’s office, struggling with cuts, sometimes fields as few as six deputies for graveyard patrol in the 720-square-mile expanse of Contra Costa County. By comparison, Richmond employs 10 officers at minimum in the wee hours. Antioch and Concord both have around six, all serving far smaller territories.

Police departments typically staff lightly in the early morning because they get few calls. When they must cut the patrol, they often look to the graveyard shift, with its lower call volume, for relief.

The Sheriff’s Office, with its well-publicized budget troubles, pared its graveyard shift to a skeleton in 2008.

“People really do need to know,” said Jim Bickert, president of the deputy sheriff’s association. “At certain times of day, they should be mentally prepared to handle their own business.”

The Sheriff’s Office divides its service area into 15 patrol beats, each ideally staffed by one deputy on each work shift. Each shift overlaps with the prior shift. So, at full staffing, 15 to 30 deputies would patrol and respond to emergency calls in such far-flung unincorporated communities as Crockett, Byron and Alamo.

But these days the agency typically uses six to eight deputies on graveyard shift, not counting a pair of supervising sergeants. Swing shift overlaps with graveyard shift, but for a few hours after midnight, the sheriff makes do.

“As you can imagine,” said Capt. Mark Williams, who supervises the sheriff’s patrol, “a simple issue such as a mechanical failure can have a tremendous impact on our response time, considering our limited staffing.”

That happened a little past midnight June 9, when Hegarty woke to sounds outside her bedroom window, noticed backyard items amiss, saw the exterior door leading to the furnace room ajar.

The two nearest deputies, five miles away, were scouring the pavement for shell casings in North Richmond, where callers reported gunfire.

One of their patrol cars broke down. A tow truck came. One deputy drove the other back to the station, behind the tow.

About then, Hegarty discovered her home phone did not work.

“I was really worried about what would happen if he got out,” said Hegarty, who used her cell to call 911. “He could kick down my door.”

A dispatcher waited with her. The supervising sergeant got the call at 12:44 a.m., but lacked anyone to send until 12:56 a.m., when the tow truck reached West County Jail in Richmond and the deputy changed cars.

In 2009, half as many patrol cars circulated at night because deputies rode two to a car.

Anticipating a $10 million cut for the 2009-10 fiscal year, former Sheriff Warren Rupf deployed three cars on weeknights and four on weekends, each with two deputies.

The pairings theoretically made life safer for deputies, as they did not need to wait for help from other cars.

But the tiny fleet could not reach calls quickly, or at all, if backed up on an earlier call.

So the same number of deputies now ride solo.

“The bad part is “… when you do the job, you may be tempted to just go to a call without cover, even if you need it,” Bickert said.

The sheriff may disband one of its two “J-Teams” to backfill graveyard patrol staffing, Williams said. J-Team deputies supplement patrol in crime hot spots and assist in detective work.

“The downside is that we have fewer resources for direct enforcement operations “… to mitigate violent crimes,” Williams said, “or to suppress an area plagued by burglaries, for example.”

Dees, now subject to a lengthy criminal complaint, had nested for the night in Hegarty’s basement furnace closet while she slept, blocking the door with debris. Deputies dragged him out kicking after he smashed the light with his machete.

He cut the house phone line, and also its water main — Hegarty found her yard flooded when the sun rose. He tore her furnace apart and pulled pipes off the wall.

“I was so scared,” Hegarty said. “He was trying to kick out the siding, The whole house shook, literally.”