House Speaker Nancy Pelosi sounded a hopeful tone Tuesday about Republicans and Democrats striking an agreement on a staggering stimulus package to blunt the economic damage from the coronavirus pandemic.

"I think there is real optimism that we could get something done in the next few hours," Pelosi told CNBC's Jim Cramer in a phone interview on "Squawk on the Street" as Senate Republicans and Democrats moved closer to a deal.

The California Democrat later added that the bill is "getting to a good place ... if they stay there."

Pelosi has criticized versions of the GOP's developing legislation, saying it goes too far to help corporations damaged by the outbreak without doing enough to aid workers ravaged by it. House Democrats released their own $2.5 trillion relief plan on Monday — though it is unlikely to go anywhere as long as the Senate makes progress.

Major U.S. stock indexes climbed more than 5% on Tuesday as optimism about a deal rose.

Democrats had taken particular issue with the potential conditions imposed on ailing corporations that receive aid from a pool of $500 billion in taxpayer money.

Pelosi said Tuesday "things like a $500 billion slush fund are really insulting." But the speaker said she was encouraged by the Trump administration agreeing to add more oversight to how it doles out the funding pool, which she called a "big change." Pelosi noted that the proposal would include an inspector general and a congressional panel of five people to oversee the aid.

"We think the bill has move sufficiently to the side of workers," she said.

Congress has faced enormous pressure to rescue the economy and health-care system as patients overwhelm hospitals, workers get laid off and businesses small and large suffer. If lawmakers can come to an agreement on a stimulus package, it would be the third proposal they have passed to respond to the pandemic raging across the U.S.

More than 46,000 people have had COVID-19 in the U.S., while at least 593 people have died from it, according to Johns Hopkins University.

President Donald Trump applied more pressure to Congress on Tuesday morning. In a tweet, he said "Congress must approve the deal, without all the nonsense, today."

"The longer it takes, the harder it will be to start up our economy. Our workers will be hurt!" he wrote amid reported frustrations about the economic havoc caused by businesses shutting down across the country.

Donald Trump tweet

On Monday, Trump suggested that he wants to urge businesses to reopen — sooner rather than later — while the government works to fight the coronavirus pandemic.

Senate Democrats blocked Republican efforts to move legislation forward twice on Sunday and Monday, sparking a level of anger rarely seen on the Senate floor.

House members are currently out of Washington at least until they have a stimulus agreement to consider. Safety has become a major concern for lawmakers after two representatives and a senator tested positive for COVID-19, forcing other members of Congress with whom they interacted to go into isolation.

Pelosi told CNBC she hopes the parties come to a widely accepted agreement the House can pass by unanimous consent — meaning it could quickly approve legislation without returning to the Capitol. But any one representative could hold up the mammoth spending package under that process.

Correction: The House proposal would cost $2.5 trillion. An earlier version of this story misstated the figure.

Subscribe to CNBC on YouTube.