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.
curl -O https://raw.githubusercontent.com/GabrielOnDelphi/Claude-Tools-for-Delphi/main/.claude/skills/light-ref-Threading/SKILL.mdgit clone --depth 1 https://github.com/GabrielOnDelphi/Claude-Tools-for-DelphiWrote 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.
[](https://agentmods.dev/skills/gabrielondelphi/claude-tools-for-delphi/light-ref-threading)<a href="https://agentmods.dev/skills/gabrielondelphi/claude-tools-for-delphi/light-ref-threading"><img src="https://agentmods.dev/badge/skills/gabrielondelphi/claude-tools-for-delphi/light-ref-threading.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00120 | $0.02633 |
| Opus 5 | $0.00060 | $0.01316 |
| Sonnet 5 | $0.00024 | $0.00527 |
| Haiku 4.5 | $0.00012 | $0.00263 |
Grade A, and why
light-ref-Threading 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.
How it starts
The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Delphi threading — reference
Load before writing or reviewing any code that runs off the main thread. Threading is RTL/PPL territory — LightSaber has no multithreading helpers, so do not go looking for one.
Units: TThread — System.Classes · TTask/TParallel/IFuture<T> — System.Threading · TCriticalSection/TEvent/TInterlocked/TLightweightMREW — System.SyncObjs · TThreadList<T>/TThreadedQueue<T> — System.Generics.Collections · TMonitor — System (no uses entry needed).
The one rule that is never optional
A worker thread must never touch a visual control or the UI directly. This holds on VCL and on FMX (Android/iOS included). Marshal every UI update back to the main thread with TThread.Synchronize (blocking) or TThread.Queue (non-blocking).
// WRONG - crash or corruption
TThread.CreateAnonymousThread(procedure begin lblStatus.Text := 'Working'; end).Start;
// RIGHT
TThread.CreateAnonymousThread(
procedure
begin
TThread.Queue(nil, procedure begin lblStatus.Text := 'Working'; end);
end).Start;
Lifetime — VCL & FMX: a queued/synchronized closure runs later on the main thread; if the form or control it touches was freed meanwhile, you get a dangling access. This is not mobile-only — a VCL form closed while a worker still runs hits it too. It just fires far more often on mobile, where the OS backgrounds the app and tears down views on its own. Assigned does not save you: a freed object is still non-nil, so Assigned(Form) returns True and you crash anyway. Fixes, in order:
- Stop the worker before its target is freed. In the form's
OnClose/destructor justFreethe thread:TThread.Destroyitself callsTerminate, waits forExecuteto finish, then purges the thread's pending queued closures viaRemoveQueuedEvents(Self)(System.Classes.pas,ShutdownThread). CallingWaitFor/Freefrom the main thread cannot deadlock on a worker sitting inSynchronize— main-threadWaitForpumps the synchronize queue while it waits (TThread.WaitFor, both Windows and POSIX branches). RequiresFreeOnTerminate = False(see pitfall below). - Queue against the thread instance, not
nil, when the target's lifetime is uncertain. Inside aTThreadsubclass simply call the instanceQueue(...)— it forwards toQueue(Self, ...). Destroying that thread then purges its pending closures;TThread.Queue(nil, ...)has no such safety net.nilis fine only when the closure touches nothing that can die before it runs.
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.
- 2d ago Changed · +2 lines 6d803324ef3d
- 6d ago First seen · 176 lines · 120 tokens per session scan A d5f0cadd8ae8
light-ref-Threading is a skill published in the GitHub repository GabrielOnDelphi/Claude-Tools-for-Delphi (17 stars, last pushed today), licensed MPL-2.0. It adds 120 tokens to every session and 2,633 once invoked, about $0.0006 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.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…