Starbucks’ interim chief executive cashed in more than $341,000 in company stock on news that the java giant tapped Chipotles CEO Brian Niccol to replace its embattled boss Laxman Narasimhan, security filings show.

Rachel Ruggeri — the Seattle-based coffee chain’s chief financial officer who will be its interim CEO until Niccol officially takes the reins on Sept. 9 — sold 3,750 shares to bag a windfall of $341,850, according to a Securities Exchange Commission filing.

Ruggeri — who was awarded the shares during the past two years as part of an executive compensation program — sold the stock as part of a so-called 10b5-1 plan that allows company insiders to make predetermined trades and thereby avoid insider trading allegations. 

After the news hit that Starbucks had hired Niccol — a respected turnaround guru also known for his successes at Taco Bell and Pizza Hut — Starbucks shares surged 24.5% on Tuesday to close at $95.90.

The rally triggered a price threshold in Ruggeris plan, a Starbucks spokesperson told The Post.

The plans are overseen by brokers and are typically executed at regular intervals. They can also have price benchmarks for when the stock is sold.

Many of our executives whose compensation is tied to company performance have similar type plans,” the Starbucks spokesperson added.

As part of the program, Ruggeri also sold 3,750 shares on May 22, netting $300,000, according to the filing.

She and her financial planners apparently planned for a variety of contingencies one of which appeared to be highly beneficial today, said securities attorney Randy Katz of law firm Clark Hill LLP.

No other trades by company brass were reported on Tuesday. In fact, her trades were filed with the SEC even before the companys management shakeup appeared on the SECs website.

Its probably fair to assume that other Starbucks executives didnt benefit from the stock pop the way she did, added Katz.

Starbucks stock price took a hit in April when the worlds biggest coffee company by location and sales reported its first drop in same-store sales in nearly three years.

Howard Schultz, who built the chain into a global behemoth in the 1990s, slammed Narasimhans management style on LinkedIn in May.  

Narasimhan has been forced to lower Starbucks’ earnings estimates several times since he took the helm last April.

Starbucks has also been dealing with a widespread unionization effort since 2021.