I shouldn't judge from a piecemeal HN post. But the picture I'm getting is "Know-it-all Javatecht VP of Enterprise AbstractFactoryCorporateWarfareObject Development."
Here's some news: there's no such thing as a CTO (or for that matter, CEO) in a four-perspn company. It's cargo-cult status-seeking: the CTO of $BIG_CORPORATE where I used to work was rich and important, so I'll give myself the same title and I will be too. What's missed is that the actual status comes from having humans to boss around. So in a startup titles are basically equity: worthless until we're profitable.
Fire the CTO. He doesn't code, he's causing problems. If you really need him for his experience with "Enterprise-ready," hire him on a consulting basis for a few hours a week to tell you what to google. But if he's not coding...what is he doing?
Hmm, how big is this company? I can't imagine a startup with a CTO that doesn't actually doing any coding until well beyond the bootstrap stage, this seems odd to me.
Unless your are failing to get your code working there is almost no good reason to tell you to leave, this seems like some sort of power play. I would tread carefully if I were you. Even if they did decide it's better off without you "Expect to leave in 3-6 months" is a giant WTF? Why tell you now unless they are going to sweat you to give up equity. Telling you you aren't a good coder is a good way to get you to feel like your contribution to the company is less than it really is, but it sounds to me like you must have done all the work. Even if this CTO helped with the scope and guidance to get everything going better, what would they have if you took all your work and left with it? (Not saying you should try that, just realize how much of what is important did YOU actually create) Unless almost everything you've done is getting thrown out, you are probably undervaluing your contributions, from what you've said.
Wait, what? You're less than 20 people and the CTO doesn't write code? That's news, and weird in all ways. Danger ahead!
But there are many things I assume in this story. Is everyone full time? How many people are there? How much of your money/time so far versus other money? Did the other founder have the same vesting schedule? Are there Angel investors? Is the CTO a friend of your co founder or other investor? There's too much unknown here. Make sure you answer all of this for your own lawyer!
No offence but you seem a little naive and/or inexperienced. In addition to the strong recommendation to get your own lawyer now, I would suggest you read "The 48 Laws of Power" by Robert Greene to get a crash course in things people do to try to obtain power. You may begin to see the CTO in your situation in a different light.
HINT: This has nothing to do with your coding ability
He doesn't do development himself(he does review everything before it goes into the production branch), simply that he knows better developers than I.
I have re-written much of our original code to a point where it is of good quality, both in it's intended role and in readability.
I did have a habit of cutting corners which later came back to bite us but that is not the case anymore.