Thanks for your question on Healthcare Magic.
I can understand your concern.
The way you are describing, this thing is mostly pulled
intercostal muscle.
Your symptoms are associated with movements, postures etc. So possibility of pulled muscle is more.
But better to rule out internal lung pathology first.
So get done chest
x ray and
ultrasound examination of local part.
If both are normal then no need to worry for major lung related diseases.
Apply warm water pad on affected areas.
Avoid movements and postures causing this.
Avoid heavyweight lifting and strenuous exercise.
Avoid bad postures in sleep.
Don't worry, you will be alright with all these.
Hope I have solved your query. I will be happy to help you further. Wish you good health. Thanks.