Delphi in all its glory (part 5) : AI-assisted development
Writed by : Gabriel Moraru
Published date : 20/03/2026
ISBN-13 : 9798252990866
Language : English
Web site : https://gabrielmoraru.com/the-delphi-in-all-its-glory-book-5-ai-assisted-development-for-delphi/
There are a gazillion books about AI out there. This is the only one written for Delphi developers.
No hype, no inflated promises. Just raw results from testing Claude Code on over 200,000 lines of production Delphi code - failures included. This is the AI book the big publishers will not write, because our community is too small for them. But not for us.
What you will master:
- How LLMs actually work: tokens, context windows, hallucinations, and why Claude produces better Delphi code than the alternatives (while still making maddening mistakes).
- Installation to production in one book: step-by-step setup on Windows, connecting Claude to your Delphi project, compiling from the command line, and reading errors through the AI.
- The day-to-day workflow: essential commands, code review techniques, and practical patterns for making AI useful rather than just impressive.
- Real-world stress tests, not toy calculators: what Claude did well, what it got wrong, how much it cost, and how much time it actually saved.
- The single most important thing you can do: writing CLAUDE.md documents that teach Claude your coding conventions, turning generic code into code that looks like yours.
- Advanced techniques: MCP servers, hooks, sub-agents, IDE integration, and the tools that multiply the AI effectiveness.
- Under the hood: cost and token management, data privacy, and security. Know exactly where your code goes and who sees it.
If you maintain legacy code - especially pre-Unicode Delphi - the AI is a direct ticket to heaven: it is far better at fixing broken code than at writing new clean code.
eBook available at www.GabrielMoraru.com
1. About this book 3
No click-bait, no pompous title 3
Why I Wrote This Book 3
Who This Book Is For 4
Who Will Benefit Most From This Book? 4
What You Need to Know Before Reading 4
Why Claude Code? 5
What This Book Covers 5
What This Book Does NOT Cover 6
My Position On AI 6
How is this book written? 7
Environment-responsible 8
Who am I? 8
Symbols and conventions 9
2. Table of contents 10
3. Introduction to AI and LLMs 25
How It All Started 25
When to Use AI 25
A Word of Warning 26
The Future 27
How LLMs Work 28
The Secret Ingredient: CLAUDE.md 33
Agents 34
Claude Code, Gemini CLI, and GitHub Copilot 35
Pros and Cons of AI in Programming 37
4. Meet Claude 42
Installing Claude Code on Windows 43
Installing Claude under WSL 49
What Claude Can and Cannot Do 50
AI Code Quality: The CodeRabbit Report 52
How Claude Code Works 59
The Agentic Loop 59
The Context Window 60
Navigating Large Codebases (The Flashlight Problem) 63
The Permission System 68
The /clear Command 83
Auto-Compact 84
Running Multiple Sessions in Parallel 85
Plan Modes 89
The /powerup Command 92
Configuration and /config 97
Choosing a Model 98
Making Claude Think Deeper And Faster 106
Settings files 114
The Memory System 118
Status Line Customization 122
Sandboxing 128
Running Claude From the Command Line 131
Essential Commands Reference 134
Keyboard Shortcuts 139
Claude's Toolbox 140
Switching Models and Effort on the Fly 145
Cool Tricks 148
Claude Beyond the Terminal 150
The Desktop App 151
Running Tasks in the Cloud 162
5. Claude and Delphi 165
How Good is Claude at Delphi 165
Lying With Confidence 166
Failing Basic Tasks 167
Laziness 168
Overengineering 169
Setting Up a Delphi Project for Claude Code 169
/init 171
The CLAUDE.md File 173
The Build Script 186
Unit Testing with Claude 187
Backup And Cleanup Tools 191
Prompt Templates 192
Reviewing an Existing Project 197
Building A Delphi Project 199
IDE Integration 202
Smart CodeInsight 207
RAD AI Companion 209
CodeBot for Delphi 210
Third-Party AI Plugins for Delphi 211
Autopilot for Delphi 219
6. Hooks - Automating Your Claude Code Workflow 224
What Are Hooks? 224
Where Hooks Are Configured 224
Available Hook Events 225
Practical Examples for Delphi Developers 226
What You Cannot Do with Hooks (Yet) 233
When the AI deletes a file, where does it go? 233
7. Common Workflows for Delphi Developers 235
Understanding a New (or Old) Codebase 235
Bug Fixing 237
Refactoring Old Delphi Code 238
Adding Features to Existing Projects 239
Code Review Workflow 241
Working with Tests (DUnitX) 242
Generating Documentation 243
Using Plan Mode for Safe Exploration 245
Reviewing Legacy Code 250
The One-File-At-A-Time Workflow 251
8. Best Practices for Delphi Developers 256
Give Claude a Way to Check Its Own Work 256
Explore First, Then Plan, Then Code 257
Write Better Prompts 257
Structure Your CLAUDE.md Right 258
Manage Context Like Your Life Depends On It 260
Common Failure Patterns (Delphi-Specific) 265
9. Managing Costs and Token Usage 267
What Are Tokens? 267
How Token Costs Work 268
Subscription Tiers 269
Rate Limits 270
Why Delphi Projects Eat Tokens Fast 272
How to Reduce Token Usage 272
Tracking Your Costs 278
The 5-Hour Window Mirage 281
Building the Token Vampire 283
10. Skills 292
What Are Skill Files? 292
Where do skills live? 292
How to create a skill 292
Skills vs CLAUDE.md 293
The YAML header options 293
The $ARGUMENTS variable 296
Practical examples for Delphi programmers 296
11. Sub-agents 299
Why Sub-agents Matter 299
Skills vs Agents 300
Built-in Sub-agents 303
Creating Your First Sub-agent 304
More Delphi-Specific Agents 310
Running Sub-agents in the Background 314
Multitasking - Running Multiple Tasks at Once 318
Sub-agents vs. Ctrl+B 322
12. Is the Grass Greener? A Look at Gemini CLI 324
The Pricing Difference 324
So Should You Switch? 325
Installing Gemini CLI 326
Compared to Claude Code 328
13. MCPs - Connecting Claude Code to External Tools 329
What Can MCP Do? 329
How MCP Works 329
Installing MCP Servers 330
MCP Servers Useful for Delphi Developers 331
Delphi-Specific MCP Servers 333
Building Your Own MCP Server in Delphi 335
Editing Word Documents with SuperDoc MCP 338
14. Checkpointing and Rewind 344
What Checkpoints Are 344
How to Rewind 344
The Summarize Option 345
What Gets Checkpointed 346
Checkpoints vs. Git 349
Reviewing Changes: The Diff Viewer 350
15. Commands 353
/ultrareview - Bug Hunting in the Cloud 353
/review vs /ultrareview 354
/insights 356
16. Data Privacy and Usage Monitoring 362
What Happens to Your Code? 362
Telemetry: What Phones Home 363
The Analytics Dashboard 365
Security Risks of AI-Assisted Development 368
When AI Agents Go Rogue 368
Poisoned Configuration Files 370
Cognitive Risks: When AI Thinks For You 372
17. Issues, Tips, Tricks and Fixes 376
Claude Behavior, Accuracy And Reproducibility 376
Bad Sessions Are a Real Thing 377
Personality Priming 378
Voice Dictation 382
Fixing the Status Line Numbers 384
18. My books 389
Next books 392
Source code 392
19. Quick Reference 393
In-Claude commands 393
Keyboard shortcuts 393
Command line 394