Vibe Coding the Knight's Tour with OpenAI Codex CLI
"Vibe coding" — Andrej Karpathy's term for building software by describing what you want in plain English and letting an AI agent write the code — has gone from a throwaway phrase to Collins Dictionary's Word of the Year. This is a real vibe coding session with OpenAI's Codex CLI: no line of Python below was typed by hand.
This walkthrough builds a full Knight's Tour solver — Warnsdorff's heuristic, a pytest suite, and a Flask web visualisation — driven entirely through natural-language Codex prompts, with an AGENTS.md spec and diff review keeping it disciplined rather than pure "slop coding."
Three-phase workflow
- Plan the solver, interfaces and acceptance criteria in natural language.
- Implement the algorithm and web view, asking Codex to keep changes focused.
- Verify with pytest, inspect the diff and run the app locally before accepting the result.
An AGENTS.md file records project conventions so later prompts remain consistent. Short feedback loops make it easier to catch incorrect assumptions before they spread.
Why this example works
The Knight's Tour has a clear success condition, deterministic tests and a visual result. That makes it a practical example for learning how to guide an agent through repository changes while retaining review control.
For the hardware context behind local coding and inference, see the Mac Mini M4 vs Mac Studio benchmark.
Read the full walkthrough on malcolmlow.com.
Top comments (0)