Xanax (alprazolam) and other benzodiazepines can be used for claustrophobia, but only when it is combined with exposure therapy. Claustrophobia, which is an extreme fear of closed and confined spaces, is a specific phobia. And all specific phobias are not really amenable to medications such as SSRIs and SNRIs. But benzodiazepines can be used when they are combined with exposure therapy for the treatment of claustrophobia.