I was swapping my frame and quite a few other components last night and I found this part on the floor when clearing up.
I installed a new headset and bottom bracket which I am pretty sure it didn't come from. I also installed old front and rear mech and shifters but put in new gear inners and outers. It looks the right size to be associated with gear cables. the shifters are XT combined brake/gear shifters. It looked dirty when i picked it up so it must have come from somewhere it is about 15mm long.