SACRAMENTO — It was headline news when Gov. Jerry Brown and legislative leaders reached a deal to spend an extra $600 million next fiscal year on shelters and other local measures to try to reduce the number of homeless people in California.

But there’s an even bigger number tucked away in the 2018-19 budget for lawmakers’ home away from home — the state Capitol. The state would spend $1.2 billion as part of a project to replace the 66-year-old annex to the historic Capitol under the budget that the Assembly and Senate will vote on this week.

The need for replacing the annex has long been talked about, but lawmakers have acknowledged the potential for a perception problem if they spend heftily on their own offices. While trying to sell need for the upgrade, they also run into the issue of highlighting hazardous conditions in a place where their staffs work daily.

The annex houses the governor’s office, as well as the offices of legislators and their staffs. It’s connected to the 19th century Capitol building — sort of. As generations of confused tourists have discovered, the two structures don’t exactly line up, so the annex’s third floor, for example, connects to the Capitol’s second floor. The fourth floor on the historic side of the building links to the annex’s sixth floor.

A door in the Senate leads to what used to be the outside wall of the original Capitol building that is now trapped between the buildings.

But these oddities are not why the current annex is coming down. Its list of safety problems is extensive, according to the state Department of General Services: Water pipes are corroded, there are no fire sprinklers in parts of the building, there aren’t enough fire exits and disabled people have access problems, among other issues.

“This annex has become a straitjacket,” said Assemblyman Ken Cooley, D-Rancho Cordova (Sacramento County), who has led efforts to replace the structure. “It does not welcome all Californians.”

But, if the annex is coming down, the Legislature and next governor will need a place to go. So the state is proposing to build a new office building near the Capitol first to house the elected officials and their staffs. The budget calls for $630 million in general fund spending toward tearing down and replacing the annex. Another $125 million in existing funds would also be used for the project.

If all that money is spent on other items before construction begins, lawmakers will also approve a backup plan: $756 million in lease revenue bonds. The budget also calls for $423 million in lease revenue bonds for the new state building near the Capitol.

After the annex is complete, those offices would move back and the new state building would house other public employees.

The main Capitol building will stay open during construction, hosting Assembly and Senate sessions as well as committee hearings.

Before any of this can happen, the Legislature must pass the budget by Friday, and Brown must sign it by June 30. That’s a much less drama-filled process than it used to be, thanks to to an initiative that state voters passed in 2010.

It reduced the voting threshold to pass a budget to a majority from two-thirds, carving the minority party — Republicans — out of the process.

The second part of the initiative is the real hammer: Lawmakers don’t get paid if they don’t approve a spending plan by June 15.

Melody Gutierrez is a San Francisco Chronicle staff writer. Email: mgutierrez@sfchronicle.com. Twitter: @MelodyGutierrez