WASHINGTON — President Trump said on Monday that he would oppose any effort to reduce the amount of pretax income that American workers can save in 401(k) retirement accounts, effectively killing an idea that Republicans were mulling as a way to help pay for a $1.5 trillion tax cut.

The directive, issued via Twitter, underscored a growing fear among Republicans and business lobbyists that Mr. Trump’s bully-pulpit whims could undermine the party’s best chance to pass the most sweeping rewrite of the tax code in decades.

Overhauling the tax code was never going to be easy given that it requires targeting lucrative and politically popular tax breaks to mitigate the magnitude of cuts Republicans are envisioning. Lawmakers must mitigate the revenue loss from those tax cuts in order to avoid a Democratic filibuster and pass a bill along party lines.

Publicly and privately, supporters of the Republican tax effort say they are concerned that Mr. Trump will make a hard task even harder. The Republican effort to repeal the Affordable Care Act was a similarly difficult effort, and the president’s comments and actions were often not helpful. For instance, Mr. Trump hosted House Republicans in the Rose Garden to celebrate passage of a bill to repeal the Affordable Care Act, only to call the same bill “mean” later. Last week, he confounded Republicans again by backing away from his endorsement of a bipartisan Senate proposal to stabilize health insurance markets.