There’s a mysterious network bug in OS X 10.10 Yosemite. The symptom is that the shared name (as viewed in the Sharing System Preferences pane) of one or more of your OS X devices keeps changing. It may start out, for example, as “My MacBook.” Check back later and it will be “My MacBook (1).” Still later, it will have morphed to “My MacBook (2)” ad infinitum. These changes occur without any action on the part of the user.

If a number gets appended to the name of your computer in Sharing, you’re probably a victim of the bug described here.
Adding to the annoyance, the multiple names begin to populate the Shared section of Finder sidebars—as seen on every Mac within your local network. The result is that your sidebars soon wind up with several numbered items representing the same drive, all but one of which fail to connect to anything. If you’re lucky, there are no other overt symptoms. If you’re not lucky, you may find that the renamed volume loses its connection to iCloud or other shared services.
The proximate cause appears to be that the computer temporarily loses its connection to the network, perhaps when the device goes to sleep. When the connection is re-established, the AirPort device (or other router) mistakenly (due to the OS X bug) sees it as a new device with the same name as a pre-existing device. So a number is added to the name to establish a distinction.
I called this bug “mysterious” because no one has pinned down the ultimate cause that explains what starts this ball rolling in the first place. It’s also not clear why some devices show this symptom and others do not.
The bug actually predates Yosemite. Like an illness that goes into remission and then returns, its presence has waxed and waned over time. However, as confirmed by numerous forums threads and Twitter posts, the bug resurfaced with a vengeance after the release of OS X Yosemite—which is why I am writing about it now.
So what can you do about it?
You can, of course, reset the name of your computer in the Sharing System Preferences pane. But this is not a cure. The renaming will soon begin again.
Various work-arounds can potentially put a permanent stop to the matter. The one that most people report as successful is to disable “Wake for Wi-Fi network access” (called “Wake for network access” on some Macs) in the Energy Saver System Preferences pane. A few users have claimed that repairing disk permissions also works, although others have found it has no effect (as covered in an Apple Support Communities thread that offers an assortment of possible fixes).

Disabling this option may prevent your Mac from renaming shared devices.
Even if you succeed in ending the renaming, the existing additional names in Finder sidebars will likely remain indefinitely. There is no obvious way to delete them. You can’t drag them off the sidebar. There is no relevant Delete command. Restarting has no effect. What typically works is to unplug your AirPort device (or other router) for a minute or so. This clears the names from the router’s cache.
Although Apple has not offered confirmation, some users report that updating to Yosemite 10.10.1 entirely eradicates the bug, allowing you to re-enable “Wake for Network Access” without the return of the renaming cascade. This has been the case for me, at least so far. Note: Yosemite has been plagued with a separate Wi-Fi access issue, which also may or may not have been fixed by the 10.10.1 update.