Anafranil is a tricyclic antidepressant used primarily to treat obsessive-compulsive disorder (OCD). It is known by the generic name clomipramine. The drug works by affecting the balance of neurotransmitters in the brain, particularly serotonin and norepinephrine.