I would like to put out a word of warning to any travellers in Bagamoyo that there is an increase in the number of muggings happening around Bagamoyo. Our travel guide reported that there were rumours, but no direct reports of muggings, and yet we were attacked by guys with knives on the beach, no more than 200m from our hotel.
Everyone was very quiet on the subject before the incident. We even asked the hotel staff if it was safe to walk to the village, and no one said a word. After the incident, stories started pouring out about recent attacks. A young girl was beaten up for her laptop in the mid-afternoon, $500 stolen from another gentleman's hotel room, the hotel manager then told us that no one should walk out on the beach without a panga to protect themselves! The police there was less than useless and require a fee per item that you report stolen, and they quite blatantly told us that they would require repayment for any items that they recovered.
According to the locals, there is a rapidly growning herion trade through Bagamoyo, and this could account for the increased crime, along with general poverty and the "end of the road" status that Bagamoyo has. So, if you decide to go to Bagamoyo, go with pepper spray and as few valuables as you can manage!