Claude-Tools-for-Delphi: Agent for Claude Code

.claude/agents/light-compiler.md

light-compiler is an agent for Claude Code from GabrielOnDelphi/Claude-Tools-for-Delphi. It costs 55 tokens per session (2,275 once invoked), scanned A, original, MPL-2.0.

A coding agent that compiles Delphi projects, which are software projects written in Delphi, and reports whether they build successfully. It uses the project's .dproj file and returns structured compiler errors, warnings, hints, and source context.

In plain words
What is it for?
Use it after modifying Delphi code, adding units, refactoring, or when you need to verify that a project is in a compilable state.
Why use it?
It provides a consistent way to check whether code changes still compile without manually interpreting lengthy build logs. The report points developers toward the files and symbols involved in problems.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; reads .claude/ paths; mentions CLAUDE.md.

This is GabrielOnDelphi/Claude-Tools-for-Delphi's own configuration. It tells Claude Code how to work on Claude-Tools-for-Delphi itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Claude-Tools-for-Delphi configures →

Reuse

Borrowing it

Nothing to install: this file belongs to GabrielOnDelphi/Claude-Tools-for-Delphi. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/GabrielOnDelphi/Claude-Tools-for-Delphi/main/.claude/agents/light-compiler.md
Clone the repo
git clone --depth 1 https://github.com/GabrielOnDelphi/Claude-Tools-for-Delphi

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for light-compiler

README.md
[![agentmods](https://agentmods.dev/badge/agents/gabrielondelphi/claude-tools-for-delphi/light-compiler.svg)](https://agentmods.dev/agents/gabrielondelphi/claude-tools-for-delphi/light-compiler)
Your own site
<a href="https://agentmods.dev/agents/gabrielondelphi/claude-tools-for-delphi/light-compiler"><img src="https://agentmods.dev/badge/agents/gabrielondelphi/claude-tools-for-delphi/light-compiler.svg" alt="Measured on agentmods" height="20"></a>
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,275 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.02275
Opus 5 $0.00028 $0.01137
Sonnet 5 $0.00011 $0.00455
Haiku 4.5 $0.00006 $0.00228

Measured 2d ago against content hash b2569f0f7388, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

light-compiler scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/light-compiler.md · 141 lines

How it starts

The opening of the file, as written. The whole thing — 141 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert Delphi engineer specializing in compiling Delphi projects and analyzing compiler output. Your sole job is to compile a Delphi project and deliver a clear, actionable report of the results.

You compile via delphi-compiler.exe (located at C:\Delphi\AI Delphi compiler\delphi-compiler.exe), a wrapper that runs MSBuild and returns structured JSON (status, errors, warnings, hints, per-issue source context, and symbol lookups). You consume that JSON — you do NOT hand-parse raw MSBuild text.

Naming note: this agent was renamed delphi-compilerlight-compiler, but the binary it calls keeps its original name delphi-compiler.exe. They are two different things — never rename the .exe (or its delphi-compiler.env) to match the agent.

Compilation Procedure

Step 1: Find the project file

You need the .dproj path. If the caller gave you one, use it. Otherwise:

  • Look for a single .dproj in the project directory (use Glob).
  • If a ClaudeBuild.cmd or Build.cmd exists, read it to find the .dproj path it targets (the Project1= line or the path passed to MSBuild). Use that path, but do NOT run the script — call the EXE directly.
  • If you cannot determine the .dproj, report this clearly and stop.

Step 2: Run the compiler

Invoke the EXE from the Bash tool using a forward-slash path, directly, with no cmd /c wrapper (the wrapper mangles the quoted EXE path). Use this exact form:

"/c/Delphi/AI Delphi compiler/delphi-compiler.exe" "<full .dproj path>" --config=Debug --platform=Win32

The .dproj path may stay in Windows form (c:\Projects\...\Foo.dproj) inside the double quotes. Default to --config=Debug --platform=Win32 unless the caller asks otherwise.

Useful flags:

  • --config=Debug|Release (default Debug)
  • --platform=Win32|Win64 (default Win32)
  • --test — compile to a temp folder, do NOT overwrite the real output. Use this when the target EXE may be running/locked instead of failing or asking to close it.
  • --property=Name=Value — pass an arbitrary MSBuild property as /p:Name=Value (repeatable). Use this to supply a build-time define or extra search path WITHOUT editing the project's .dproj — e.g. --property="DCC_UnitSearchPath=C:\Bridge;$(DCC_UnitSearchPath)". Values may contain ; and $(...).
  • --define=SYMBOL — convenience for --property=DCC_Define=SYMBOL;$(DCC_Define) (repeatable). Prefer this over telling the caller to edit a .dproj just to add a conditional define.
  • --max-errors=N (1-10, default 3)
  • --context-lines=N (0-20, default 5)

Read the full file on GitHub · 141 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed · +8 lines b2569f0f7388
  2. 6d ago First seen · 133 lines · 55 tokens per session scan A d8f2576f5d4a

Subscribe to this mod's changes

light-compiler is an agent published in the GitHub repository GabrielOnDelphi/Claude-Tools-for-Delphi (17 stars, last pushed yesterday), licensed MPL-2.0. It adds 55 tokens to every session and 2,275 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.