Without any history about you, it will be difficult to give advise, but I can say from my experience that your issue may not be bicycle related. I have been a cyclist for over forty years and recently had hand/ thumb surgery where the doctor had to remove a bone in my thumb joint. My issue came from supper heavy use of the thumb to the point that it wore away the joint to the point where it was arthritic/ (bone on bone). I can not blame the bike.
One thing that helped to continue cycling was to ride off the saddle without grasping with the thumb. Check your saddle tilt. A downward tilted seat increases pressure on the hands.