The Great Refactor

Code worked. That was the problem.

The Arduino IDE sketch had grown organically. Functions calling functions. Global variables everywhere. Typewriter protocol tangled with AI logic tangled with LED control. Everything connected to everything.

It printed AI responses. It had a name. It worked.

But the workflow was killing me.

Arduino IDE couldn't manage the ESP32-S3-N16R8 board settings cleanly. Is PlatformIO the answer? And coding with AI meant copy-pasting. Describe a problem to Claude or ChatGPT. Get code back. Paste it into the IDE. Test. Find the issue. Go back. Describe what happened. Get new code. Paste again, or worse, manually diff.

ChatGPT had built the captive portal in minutes. Getting those changes into the actual project took longer than writing them.

Tried Cursor first. AI-native IDE. Installed it. PlatformIO extension stuck on "Initializing". Turns out the official extension isn't on Cursor's marketplace. Downloaded the VSIX manually. Installed it. Needed another extension. Downloaded that one too. Wrong binary architecture.

Gave up on Cursor. Used PlatformIO from the terminal instead.

The migration itself took all evening. In a Claude.ai chat window. ZIP files back and forth. "Here's my source code". "Compilation failed, attaching the errors". Five rounds. Fixed the errors. Zipped it up again. Sent it back. That was the last time I worked that way.

The next morning, I installed Claude Code.

An AI that lives in the terminal. Reads your codebase. Understands the project structure. Edits files, uses tools, runs tests, opens pull requests. You talk to it in plain English and it writes code. Not suggestions in the margin. Not autocomplete. An agent.

Then the refactoring started. Protocol, formatting, LED control, all in one file. Needed to split it. To test line wrapping, I'd need a physical typewriter or mock the entire class. Neither option good.

Something shifted.

Before this, I wrote code. ChatGPT helped me think through problems. Designed circuits. Debugged protocol timing. But I typed every line.

Now the typing wasn't mine anymore. The decisions still were.

Not faster because Claude Code typed for me. Faster because I could think at a different level. Architecture instead of edge cases. What the code should do instead of how to do it.

At one point I caught myself about to let it run ahead. Typed: "pause for a sec. instead of jumping in and vibe-fixing, start by scanning all the logic. remind ourselves what's there".

I was managing it. Same instinct I use at work. Review before action. Understand before changing. The collaboration felt familiar. The speed didn't.

Hobby project to professional codebase. Untested on hardware. That part comes next.