The “Delphi in all its glory” book [5] – AI-Assisted Development for Delphi

“AI-Assisted Development for Delphi” is the fifth book in the “Delphi in All Its Glory” series. Released April 2026.

 

Why This Book Exists

There are a gazillion books about AI out there. This is the only one written for Delphi developers.

Your LinkedIn feed says programmers will be obsolete by next Thursday. Meanwhile, you’re looking at real production code that real customers depend on, thinking: “Does any of this actually work for what I do?”

This book answers that question — honestly.

No hype. No inflated promises. Just raw results from testing Claude Code on over 200,000 lines of production Delphi code — failures included. From installation to advanced techniques, every example in this book is Delphi-specific. Every workflow targets native Windows applications. If you want to see Claude write a React app, there are a hundred other books for that. This isn’t one of them.

The previous books in this series each took about two years to complete. This one was different. AI is moving too fast to wait that long, so I wrote it in under three months. The result is a practical, battle-tested guide to making AI work for Delphi — written by someone who’s been shipping Delphi code since 1995.

 

Order the book in electronic or printed format.


Delphi AI assisted development with Claude Code and Gemini

It is a known fact that AI writes code faster than you.
The same can be said about the number of bugs.

 

What You’ll Learn

Part I — Understanding AI

How Large Language Models actually work — tokens, context windows, hallucinations, and why Claude produces better Delphi code than the alternatives (while still making maddening mistakes). What agents are, and an honest look at what AI can and cannot do for Delphi developers. No hype, no breathless predictions — just the mechanics and the reality.

Part II — Getting Started

Complete step-by-step installation and configuration of Claude Code on Windows. Detailed settings.json configuration, the permission system, sandboxing, the memory system, custom keybindings, voice dictation setup (including workarounds for known bugs), and status line customization. Plus: connecting Claude to a Delphi project using CLAUDE.md files, build scripts, and prompt templates — the critical infrastructure that makes AI actually useful instead of just impressive.

Part III — Using Claude Code Day-to-Day

Essential commands, the context window and how to manage it, running parallel sessions, Agent Teams, Plan Mode, building Delphi projects through Claude using MSBuild scripts, and monitoring context usage. This section teaches the practical daily workflow: how to talk to Claude, what commands matter, and how to keep sessions productive. Also covers the Desktop App, the Web interface, and the Chrome extension.

Part IV — Real-World Testing

This is the heart of the book. I tested Claude on actual production projects and documented everything — what it did well, what it got wrong, how much it cost, and how much time it actually saved. No cherry-picked examples — only raw results.

You’ll see Claude’s actual Delphi knowledge examined in detail — where it’s strong and where it falls apart. Common mistakes it makes: library hallucinations (inventing units that don’t exist), overengineering simple tasks, choosing wrong components, leaving traces of unnecessary comments everywhere. The chapter on productivity analysis is backed by industry data from the CodeRabbit report on AI code quality, giving you hard numbers instead of opinions.

Part V — Advanced Techniques

This section separates casual users from power users:

  • The CLAUDE.md skill document — the single most important thing you can do. Complete templates with explanations for every section. Two scientific studies analyzed: ETH Zurich (4% improved task success with human-written files — auto-generated ones made things worse) and SMU/Heidelberg (29% faster execution, 17% fewer tokens).
  • MCP servers for connecting Claude to external tools, including Delphi-specific MCP servers and the Context7 documentation server.
  • Hooks for automating your workflow — auto-compile after every edit, backup scripts, post-compact reminders, startup notifications.
  • Sub-agents for delegating specialized tasks: a Delphi compiler agent, a code review agent, a legacy code explorer, a unit test helper.
  • IDE integration — everything available today: Embarcadero’s Smart CodeInsight, the upcoming CodeBot by RemObjects, community plugins (Delphi AI Developer, ChatGPTWizard, CodeDroidAI), and practical workarounds for working without native Delphi IDE integration.

Part VI — Deeper Understanding

How Claude Code actually works under the hood. Best practices specifically for Delphi developers — including the “one-file workflow” for large projects (the most important workflow pattern in the book), context management strategies, the “correcting over and over” trap, and six common Delphi-specific failure patterns.

Common workflows covered in detail: understanding new or inherited codebases, bug fixing (with the full trace-the-call-chain approach), refactoring old Delphi code safely, adding features to existing projects, code review, working with DUnitX tests, and generating documentation.

Also covers: managing costs and token usage (with real-world cost scenarios), data privacy and security (know exactly where your code goes), and the checkpoint/rewind system for safe experimentation.

Part VII — The Verdict

An honest, numbers-backed final assessment. Who benefits most, who should wait, and what’s coming next in the Delphi AI tooling landscape.


Who Benefits Most?

Everyone will see some benefit from AI. But certain developers will see dramatically more:

  • Legacy code maintainers: If you maintain decades-old Delphi code — especially pre-Unicode versions — AI is a direct ticket to heaven. Here’s a secret that was meant for later in the book: AI is much better at fixing broken code than at writing new clean code. If you’re on Delphi 2009 or older, drop the hammer. You don’t need it anymore.
  • Solo developers: You don’t have a team to bounce ideas off. Claude becomes your code reviewer, your rubber duck, your second pair of eyes that never gets tired.
  • Developers inheriting unfamiliar codebases: Point Claude at a 200-unit project with zero documentation and ask “explain the architecture.” In minutes you’ll have a map that would take days to build manually.

The book assumes you already know Delphi — no need to explain basic language concepts. What you don’t need to know is anything about AI. We start from zero and build up.


Why Claude Code?

There are several AI coding tools out there: GitHub Copilot, Gemini CLI, Cursor, Windsurf, and others. Claude Code works as an agent — it reads your files, understands your project structure, runs your compiler, and iterates on errors. It doesn’t just suggest the next line of code — it takes on entire tasks. This agent approach turns out to be more useful than autocomplete-style IDE plugins.

My own testing found that Claude produces better Delphi code than the alternatives. It’s not perfect — far from it — but it makes fewer of those maddening “this looks like C# written with Pascal syntax” mistakes.

That said, all Large Language Models share the same fundamental architecture. Tokens, context windows, hallucinations, prompt engineering — these concepts are universal. What you learn in this book about working with Claude applies to any AI tool you’ll use in the future.


Key Insights from the Book

  • The 80% rule: AI gets you roughly 80% of the way there, fast. The last 20% — Delphi-specific quirks, VCL integration, DFM files — is still your job. Expecting 100% leads to frustration. Expecting 80% and cleaning up the rest is a genuine productivity win.
  • CLAUDE.md is your biggest lever: A well-written project instruction file — backed by two scientific studies — is the single most impactful thing you can do. For Delphi specifically, the payoff is even larger than what the studies measured, because Claude’s training data is thin on Delphi.
  • Review everything: Claude will invent non-existent units, silently change constant values, reformat your code, and add “helpful” nil checks that hide bugs. Diff every change. Compile after every edit. Trust but verify.
  • One file at a time: For large Delphi projects, work on one .pas unit per session with /clear between tasks. Quality drops dramatically when context fills up.
  • The community is growing: GDK Software offers dedicated Claude Code training for Delphi developers. CodeBot by RemObjects is in beta. Smart CodeInsight is built into the IDE. Context7 MCP feeds documentation into Claude. A year ago, we had nothing.

Writing Style

Fast-paced, light, occasionally irreverent. Every claim backed by evidence — links to white papers, scientific articles, proven concepts, code examples, and benchmark tests. No filler, no fluff, high information density. The author is honest about AI limitations — this book documents real experiences, including the failures and how to prevent them.

The source code for examples is available on GitHub.


The Series

This is Part 5 of “Delphi in All Its Glory” — five books, over 2,000 pages, seven years in the making:

All books are available on Amazon (print) and at www.GabrielMoraru.com (eBook).


About the Author

Gabriel Moraru is a senior software architect with over three decades of experience. He has been writing Pascal/Delphi since 1995, starting as a Z80 programmer when 8-bit was king. His academic background in applied electronics and computer science has supported his work in medical software, bioinformatics, big data, e-commerce, and robotics. He contributes to the Pascal ecosystem through his open-source LightSaber library.

Find him at www.GabrielMoraru.com.


Table of Contents

(Version 1.09 — April 2026)

Part I — Understanding AI
Chapter 0 — Introduction to AI and LLMs

Part II — Getting Started
Chapter 1 — Installing Claude Code
Chapter 2 — Configuration
Chapter 3 — Setting Up a Delphi Project for Claude Code

Part III — Using Claude Code
Chapter 4 — Essential Commands Reference
Chapter 5 — Monitoring the Context Window
Chapter 6 — Claude Beyond the Terminal
Chapter 7 — Building Delphi Projects with Claude

Part IV — Real-World Experience
Chapter 8 — Testing Claude on Real Projects
Chapter 9 — Claude’s Delphi Knowledge
Chapter 10 — Productivity Analysis

Part V — Advanced Topics
Chapter 11 — Creating a Delphi Skill Document (CLAUDE.md)
Chapter 12 — IDE Integration
Chapter 13 — MCP Servers
Chapter 14 — Hooks
Chapter 15 — Sub-agents

Part VI — Deeper Understanding
Chapter 16 — Best Practices for Delphi Developers
Chapter 17 — Common Workflows for Delphi Developers
Chapter 18 — Managing Costs and Token Usage
Chapter 19 — Data Privacy and Usage Monitoring
Chapter 20 — Checkpointing and Rewind

Part VII — Conclusions
Chapter 21 — Final Verdict

Appendix
Quick Reference — Commands, keyboard shortcuts, and tips

 

Use the comments section below if you have any comments about the book.

 

Leave a Comment

Scroll to Top