I am a programmer working for a Tech company.
There is a colleague of mine who I work with on different projects. When working with him I've noticed a bothering trend that appears to be a very successful manipulative pattern he uses.
It starts the same. We start with full cooperation and both work hard on the project. Our contributions at this stage are about 50/50. That is when we develop core functionality of a system. Then a field of additional interesting features opens up and usually each of us choses own path.
Later on, if he sees that I've implemented something valuable, he just analyzes how I did this and after some time secretly re-implements it from scratch with very minor changes or additions. That all in addition to his standard contributions and probably in free time / overtime.
After that, he claims this feature and work as his own: in meetings, documentation and email communication. Usually, I know that he is doing it from scratch by the time he accomplishes about 80% - 90%. Clever thought out.
Basically, he makes me go through the hard path of discovery and first-hand experience, then after understanding where the path lies, he simply does it himself from zero.
With time, as the amount of such softly "stolen" features accumulates, he claims major role / major contribution in a project and reacts very jealousy of any external communication from my side concerning the project.
What can I do to stop this type of "cooperation" in a professional way?