A mugger who repeatedly threatened his victim with a claw hammer before fleeing with his almost empty bag has walked free from court.