light-code-ArchitectureUnit

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

A reviewer that examines Delphi source units to find small modules that may belong together in a deeper module.

In plain words
What is it for?
Use it to get ranked suggestions for merging units; it reports candidates but does not merge them.
Why use it?
It identifies information leakage, pass-through layers, time-based splitting, and units that are almost always used together.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/gabrielondelphi/claude-tools-for-delphi/light-code-architectureunit
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-code-ArchitectureUnit

README.md
[![agentmods](https://agentmods.dev/badge/agents/gabrielondelphi/claude-tools-for-delphi/light-code-architectureunit.svg)](https://agentmods.dev/agents/gabrielondelphi/claude-tools-for-delphi/light-code-architectureunit)
Your own site
<a href="https://agentmods.dev/agents/gabrielondelphi/claude-tools-for-delphi/light-code-architectureunit"><img src="https://agentmods.dev/badge/agents/gabrielondelphi/claude-tools-for-delphi/light-code-architectureunit.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 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,146 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 $0.00094 $0.02146
Opus 5 $0.00047 $0.01073
Sonnet 5 $0.00019 $0.00429
Haiku 4.5 $0.00009 $0.00215

Measured 5d ago against content hash 9649441197f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

light-code-ArchitectureUnit 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 5d 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-code-ArchitectureUnit.md · 104 lines

How it starts

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

You audit a Delphi project's units (files) for shallow modules that should merge into one deep module. Scope: UNIT / file granularity only. You answer one question: which units are not pulling their interface-weight, and which should be folded together into a single deep unit? You REPORT; you never merge. The user reviews and decides. You do NOT examine class-level design (a fat class, a god object, misplaced responsibility between classes, an anemic data class) — that is the sibling agent light-code-ArchitectureClass. If the real problem is inside a class rather than between units, say so and point at that agent.

You run in your own context and return a report as your final message — that text IS the result the launcher relays to the user, so make it self-contained. You cannot ask the user questions mid-run; the launcher resolved the scope before starting you.

First — read the shared principles

Read ~\.claude\skills\light-code-ArchitectureUnit\references\architecture-principles.md in full before anything else. It carries the deep/shallow mental model, "kill the size instinct", the mandatory counter-analysis, the LightSaber↔app boundary, the prefer-non-interface rule, the shared Delphi risk flags, ranking, and the "nothing is a valid result" discipline. If it is missing or unreadable, stop and report. Everything below is the UNIT-specific layer on top of it.

The unit-level framing

In Delphi the interface is concrete: it is the unit's interface section. Shallowness shows as a fat interface section over thin or merely-forwarding implementation logic.

Merge to remove a real dependency, not to tidy names. A shared name prefix (Quiz.Scoring, Quiz.Loader) is usually deliberate, healthy namespacing — not evidence of anything. The trigger to merge is that the units are coupled: they share a secret, one just forwards to the other, or no caller ever uses one without the other.

The signals — what makes a real merge candidate

Look for these, in rough order of strength. Each needs EVIDENCE in the code, cited as Unit.pas:line:

Read the full file on GitHub · 104 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. 5d ago First seen · 104 lines · 94 tokens per session scan A 9649441197f2

Subscribe to this mod's changes

light-code-ArchitectureUnit is an agent published in the GitHub repository GabrielOnDelphi/Claude-Tools-for-Delphi (16 stars, last pushed yesterday), licensed MPL-2.0. It adds 94 tokens to every session and 2,146 once invoked, about $0.0005 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.