Thursday, July 09, 2026

Delphi and AI[11]: Debugging with Claude Code

Most of the noise about AI and coding is about writing new code. Just check all the examples in the recent Kai release video. Indeed, this is probably the best idea to explain what LLMs can do to a random programmer, but to me the biggest help I get from them is one the other end – not while writing new code but in debugging old, large, sometimes multithreaded Delphi programs. The kind of codebase that no longer fits in one human head, where a crash reproduces once a month on one machine in the field, and the stack trace is forty threads deep.

That’s where Claude Code really shines – as a code investigator tool. This post is a tour of how I use it for debugging, and, just as importantly, how I keep it under control.

I do specifically use Claude Code for all my debugging needs but this article is not tightly coupled to it. Most of the ideas apply the same way to other LLM-based coding tools – Codex, Gemini CLI etc.