The question of which is "better" kind of depends on what you're actually doing with the code. I'd push back a bit on the idea that one's clearly superior - they're genuinely different tools with different strengths, and which helps you more depends on your workflow and how you work with them.
From what I've seen, Claude does handle longer context windows better, which matters if you're working on a sprawling script or need to reference earlier parts of a conversation. That said, ChatGPT 4o has gotten pretty capable too, and the gap isn't as dramatic as it was a year or two ago. Where I think Claude edges ahead is when you need explanations embedded in the code itself - it tends to add useful comments without you having to ask. But here's the thing people don't always mention: ChatGPT sometimes produces code that feels more production-ready right out of the gate, even if it's less verbose. It depends if you'd rather have hand-holding or a quicker result.
Before you switch, what kind of scripts are you writing? If they're short utilities or one-off tasks, honestly the difference won't matter much and you'd be paying for a subscription for marginal gains. If you're working on longer projects where you need to keep referencing earlier code, or you really value detailed comments and explanations, then yeah, testing Claude out might be worth a month to see if it clicks with how you think. Just remember you don't have to abandon ChatGPT entirely - some people use both depending on the task.