2024 is the year of the AI, so for this AoC I decided to use Claude Code with Claude Sonnet 4 to solve the puzzles.
The purpose this time wasn't to learn a new language or algorithm, but to understand how powerful this tool is and how to use it effectively.
I was expecting this to struggle with the solutions, but it only returned a wrong answer on day 24. Except for that, the first answer it showed was the right answer.
The most important result of this exercise is the CLAUDE.md file.
I started with a basic one with simple instructions and iterated over it as we solved puzzles. We added not only fixes for things that didn't go as planned, but also improvements that made the whole process more and more automated.
Claude added most of the content in this file based on requests from me. It could definitely be improved, but I preferred to leave it as is as it worked well.
In its current form, it guides Claude to solve problems almost autonomously, from fetching the puzzle and input, to submitting it, raising PRs and addressing comments.
While Claude was exceptional at solving the puzzles, it did make mistakes and sometimes miss things. All of these were caught when CodeRabbit reviewed the PR, and Claude fixed them when raised. Having CodeRabbit review Claude's work was as useful as having a human review another human's PR.
I will take this CLAUDE.md file and ask Claude to modify it so that it can solve all the problems and merge it properly from a single prompt.
Furthermore, I will ask it to do so in a language I am unfamiliar with. Rust? Go? We'll see...
I've implemented this in advent-of-code-2018-ai.