Warren Buffett is an optimist at heart. During the financial crisis of 2008, he wrote in a New York Times op-ed, "Over the long term, the stock market news will be good." The day that article was published, the S&P 500 was down nearly 40% below its previous high.

However, Buffett is also a realist. He battens down the hatches when he doesn't see opportunities on the horizon. So what's the Oracle of Omaha's mindset these days? Watch out, investors: Buffett appears to be betting on a recession.

Warren Buffett frowning.

Image source: The Motley Fool.

Selling a lot more than buying

A pretty good way to get a feel for Buffett's mindset is to watch what he's buying and selling. In particular, if he is aggressively adding positions to Berkshire Hathaway's (BRK.A 0.64%) (BRK.B 0.54%) portfolio and not cutting many stakes, the legendary investor likely has a positive outlook for the market and the economy. But that's not the case right now. Instead, the opposite is true.

Buffett didn't initiate a single new position for Berkshire in the fourth quarter of 2022, based on recent regulatory filings. He did buy additional shares of four existing holdings. Two of those were only modest amounts -- well under 1% added to Berkshire's stake in Apple and a 2.65% increase to Berkshire's position in Paramount Global. The only aggressive buying for Buffett in Q4 was with Occidental Petroleum and Louisiana-Pacific.

Meanwhile, Buffett sold shares of twice as many stocks. He dramatically slashed Berkshire's stakes in Bank of New York Mellon, Taiwan Semiconductor, and U.S. Bancorp. Berkshire also trimmed its positions in Activision Blizzard, Ally Financial, Chevron, Kroger, and McKesson.

Buffett seemed much more positive in the third quarter of 2022. He initiated new positions in three stocks and added to existing positions in five stocks while selling shares of five existing positions and completely exiting one.

Is a recession really on the way?

To be sure, Buffett hasn't stated publicly that he believes a recession is coming. However, actions often speak louder than words. His actions certainly seem to indicate that he's keeping powder dry to buy stocks at more attractive valuations. A recession would probably give him an opportunity to do so. Stocks usually fall during the initial stages of economic downturns.

Remember, too, that Berkshire sold twice as many stocks as it bought in Q4 -- a time when many economists were predicting a recession. For example, a Bloomberg survey conducted in December 2022 found that economists forecast a 70% chance of a U.S. recession in 2023.

But is a recession really on the way? It depends on whom you ask. U.S. Treasury Secretary Janet Yellen recently stated that the likelihood of a recession is low. Yellen noted that the unemployment rate is the lowest in 50 years. The economy usually doesn't enter a recession when the employment picture is so positive.

On the other hand, the Federal Reserve could be more aggressive with interest rate hikes as a result of the hot economy and persistent inflation. Those rate hikes could cause a recession. And many Americans aren't as optimistic as Yellen is. A recent survey conducted by Primerica found that 81% of middle-income Americans think there will probably be a recession this year.

What investors who aren't billionaires should do

Should you follow Buffett's lead? Not necessarily. Don't forget the time lag with Berkshire's regulatory filings. We could find out three months from now that he reversed course in Q1 and aggressively bought stocks for Berkshire's portfolio.

However, investing in stocks that are practically recession-proof could be prudent just in case an economic downturn is around the corner. Consumer staples, healthcare, and utility stocks tend to hold up relatively well during recessions.

It also isn't a bad idea to copy Buffett by having some cash ready to invest if the economy goes south. In that 2008 New York Times op-ed, Buffett wrote, "Bad news is an investor's best friend. It lets you buy a slice of America's future at a marked-down price."

That statement from nearly 15 years ago underscores that even when Buffett is pessimistic about the short term, he's always optimistic about the long term. That's the best mindset for investors who aren't billionaires to have, too.