Costco Wholesale (COST 1.01%) has been a fantastic investment in recent times: Shares have risen 132% in the last five years, as of Sept. 7. That gain trounces the 73% increase of the Nasdaq Composite Index and the 55% rise of the S&P 500 over that same period. 

But the retailer is dealing with a bit of a slowdown following double-digit revenue growth in the past two fiscal years. Investors might be ready to sell their shares given the uncertain macro environment, even though the company has a stellar track record. 

That raises the question: Is Costco stock a buy, sell, or hold right now? Let's take a closer look at the business before figuring out what to do. 

Driving customer loyalty 

Investors who aren't that familiar with Costco might assume it's just like any other retailer -- say, Walmart or Target. This is somewhat true. Costco sells a range of products -- including groceries, clothing, electronics, and furniture -- at its brick-and-mortar locations as well as online.

Merchandise sales in the first three quarters of fiscal 2023 totaled $160 billion, making it the world's third biggest retailer, behind Walmart and Amazon. 

But Costco's key differentiator is its membership-based business model. Not just anyone can shop at one of the company's 852 warehouses. The basic membership plan costs $60 a year, a small amount to pay for access to some of the lowest prices around. Customers love Costco, as represented by its members' worldwide renewal rate of 90.5%, an all-time high. 

The company's relentless focus on incredible value and a great customer experience has driven its success. In the last five years, revenue and diluted earnings per share have increased at compound annual rates of 11% and 15%, respectively, a superb performance that has propelled the stock price. 

What should investors do? 

But back to the question at the top: whether to buy, sell, or hold the stock. There are compelling arguments for all three of these options. 

The case to buy shares is easy to make: Costco has a wide economic moat thanks to its massive scale, which allows it to flex its bargaining power over suppliers to provide low prices to customers. And the super successful membership system is proof of customer loyalty -- something all investors should look for in the companies they buy. 

And the business still has healthy growth prospects. Management said on the most recent earnings call that the plan is to open 23 net new warehouses in fiscal 2023. A lot of the expansion potential is in international markets, like China. 

Existing shareholders might be inclined to hold on to their Costco stake for all of the reasons I just discussed. They could be drawn to the current dividend yield of 0.75%, which isn't that impressive on its own, but with a lower cost basis for a long-term shareholder, this payout could be meaningful. Costco also has a track record of paying significant special dividends. The most recent was in December 2020, when each shareholder received a $10 one-time payout per share. 

Costco is a wonderful business. Even Warren Buffett's right-hand man, Charlie Munger, seems to think so: He's a member of the board of directors and has been a longtime shareholder. 

There is, however, one glaring reason to sell the stock right now: the rich valuation. At a trailing price-to-earnings ratio of 41, Costco is historically expensive. With a valuation this high, investors are probably wondering if future returns will come close to resembling the past.

With a company of this scale, I can see why it can be difficult to be optimistic about the potential for market-beating returns. If this is your way of thinking, then maybe it's a good idea to sell.