Are you doing any foam rolling? Or any kind of mobility work? What does your warm-up routine look like?
The spasm that you feel may be a result of many different things. The fix could be as simple as some extra mobility work, or it could be more complicated.
If you don't foam roll, I would suggest to begin doing that. If you're already doing it, then you might need to have someone else with a trained eye look at it.