I don't know the answer but what I do know is when people start losing their hair, their scalps get tender/sore and tight. So my advice while you try to figure out what the problem is, is to massage your scalp where you get this sensation, kneading the skin so that you loosen your scalp.
If you ever pay attention to bald people, you'll see their scalps look very rigid and stretched taut. So while keeping your scalp supple may not make much sense as a way to keep hair from thinning, the massaging will at least increase nutrient delivery by your blood to the follicles that might be ailing.