Benzos are not a good thing to take for sleep. They interfere with REM sleep, you'll get used to them and get rebound insomnia, and they're addictive so you'll eventually have to keep taking more to get the same effect or they'll stop working altogether and they're very hard to stop taking. They also are believed to interfere with the brain's ability to adapt to stress. One way to avoid this is to just use them when needed as opposed to taking them regularly. If you take them for a long time, when they wear off you get withdrawal and can feel really strange until you take your next dose, which may be what's happening when you wake up -- the drug has worn off and your anxiety is rebounding because you're used to having the drug in your system. This doesn't happen to everyone, but it happens to some people and you might be one of them. It has only recently started happening to me after years on klonopin. The difference between klonopin and xanax is that the first is long-acting but takes longer to act while xanax is short-acting but starts acting more quickly. Other than that, how well one or the other works depends on how your body reacts to it -- we all react differently. My own sense is that if you're getting panic attacks upon waking, there very well might be something going on -- a problem with sleep quality, for example (and taking benzos for sleep can cause that) so you're not resting while you're asleep, or a hormone problem, or the like. I wonder if you've ever had a really really thorough exam by a doctor who's looking or all the things that can cause anxiety and whether you've tried to solve your anxiety problem if it's not physiological with a therapist who specializes in treating anxiety. I also would recommend at least trying non-medication aids for sleep, such as hard exercise, meditation, yoga, melatonin, etc. Good luck.