If at all possible, avoid hiding hard work under a bushel!
It's common in pursing a PhD to have to do many things that appear only tangentially related to the "real" topic. However, frequently, those tangential things require ingenuity, creativity, insights and understanding, and just plain hard work. Unless the code is trivially obvious, and required no special understanding of the more central problem of your PhD research, I think that it would be a mistake to minimize it's importance. Moreover, by incorporating a discussion of the code into your thesis, you can show yet another aspect of the mastery you have of your subject matter.
It you cannot see an obvious way of putting the code into the body of the thesis, consider incorporating it into an appendix. Frequently, it is the unexpected, tangential things in one's research that end up being of more importance to the community of other researchers than the thing that was the primary focus. Consider, for example, Don Glaser, who was awarded the Nobel Prize in physics for the invention of the bubble chamber ... a side-show to his real interest which was investigating subatomic particles.