Carpal Tunnel is caused by incorrect technique. I have mild carpel tunnel as a result of being a computer programmer for years. (I have been diagnosed by a doctor.) Last year, I aggravated the condition. My piano teacher gave me an assignment which required a lot of trill like movements; I was so eager to show him I could play the piece by my next lesson that I practiced and practiced. At the end of the week, my right thumb went tingling numb. My teacher has been playing for over 40 years and never had carpel tunnel. He said I was holding my hands wrong and I was moving my fingers up and down too much rather than using arm weight. You should have an experienced piano player evaluate your technique. If you use proper technique, you will never injure yourself. As for the carpel tunnel, I went to the doctor. Luckily my carpel tunnel did not require surgery; there are exercises that help. But mainly I gave my right hand a rest for about 3 months. I switched the mouse to my left side. When I had to use my right hand I avoided the use of my thumb. I avoided activities that required my hands to point bend upward from my wrists. I rested my right wrist on soft surfaces (rolled up towel). I kept on practicing the piano but focused on the left hand. When I practiced with the right hand I would practice for only 15 minutes a couple of times a day.
Thanks to my piano teacher, I am now able to practice again for long stretches.