leakage-guard

leakage-guard is a skill for Claude Code from zpower426/datapowers. It costs 39 tokens per session (2,806 once invoked), scanned A, original, MIT.

A review guide for machine-learning features built from data ordered by time. It checks that predictions use only information available at the prediction moment and that testing matches the data’s timing.

In plain words
What is it for?
Use it to audit time-based features, rolling windows, lag values, data preprocessing, and cross-validation before training a model.
Why use it?
It helps prevent data leakage, where future or outcome-related information accidentally makes a model’s test results look better than its real performance.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the datapowers plugin — 20 skills, 3 commands, 3 agents, 1 hook shipped together

Good fit Use it to audit time-based features, rolling windows, lag values, data preprocessing, and cross-validation before training a model.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zpower426/datapowers/leakage-guard
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.

Any agent
npx skills add zpower426/datapowers --skill leakage-guard
Clone the repo
git clone --depth 1 https://github.com/zpower426/datapowers

Made for: Claude Code.

Or install datapowers, the plugin that ships this one along with the rest of its 20 skills, 3 commands, 3 agents, 1 hook.

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 leakage-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/zpower426/datapowers/leakage-guard/github.svg)](https://agentmods.dev/skills/zpower426/datapowers/leakage-guard)
Your own site
<a href="https://agentmods.dev/skills/zpower426/datapowers/leakage-guard"><img src="https://agentmods.dev/badge/skills/zpower426/datapowers/leakage-guard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for leakage-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/zpower426/datapowers/leakage-guard"><img src="https://agentmods.dev/badge/skills/zpower426/datapowers/leakage-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,806 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00039 $0.02806
Opus 5 $0.00019 $0.01403
Sonnet 5 $0.00008 $0.00561
Haiku 4.5 $0.00004 $0.00281

Measured 10d ago against content hash 8046072a77c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

leakage-guard 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 10d 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.

skills/leakage-guard/SKILL.md · 314 lines

How it starts

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

Leakage Guard

Systematically audit your feature pipeline for data leakage before any model training. Covers target leakage, temporal leakage, and cross-validation strategy alignment.

Why a dedicated skill: Leakage is the most dangerous silent failure in production ML. It inflates validation metrics by 5-40%, produces models that appear excellent in development but fail at deployment. Each type requires different detection methods.

Iron Laws

  • NO FEATURE MAY USE INFORMATION FROM THE FUTURE RELATIVE TO THE PREDICTION POINT
  • NO TRANSFORMER MAY BE FIT ON ANY DATA THE MODEL WILL BE ASKED TO PREDICT
  • CV STRATEGY MUST MATCH DATA GENERATING PROCESS (temporal data → time-based split)

Three Types of Leakage to Check

Type Description Common Sources
Target Leakage Feature derived from or correlated with target after event Post-event flags, derived aggregates using final outcome
Temporal Leakage Future data used to predict the past Rolling windows that include current row, lag features with wrong offset
Preprocessing Leakage Transformers fit on full dataset before splitting Scalers, encoders, imputers fit before train_test_split

Step-by-Step Audit

Step 1 — Map the prediction point

Before examining any code, answer:

Prediction point: [the exact moment in time when the model makes a prediction]
Target event:     [what happens after the prediction point that defines the label]
Feature window:   [the time window of data allowed as model inputs]

Example:

Prediction point: January 1st, 2024 (start of month)
Target event:     Customer churns during January 2024
Feature window:   Data from before January 1st, 2024 only

Write this down before Step 2.

Step 2 — Audit for Target Leakage

Check every feature against the prediction point. For each feature column, answer: "Could this value change after the prediction point AND be caused by the target event?"

Read the full file on GitHub · 314 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. 10d ago First seen · 314 lines · 39 tokens per session scan A 8046072a77c3

Subscribe to this mod's changes

leakage-guard is a skill published in the GitHub repository zpower426/datapowers (1 stars, last pushed 5mo ago), licensed MIT. It adds 39 tokens to every session and 2,806 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

verify

A verification command that checks an output against a reference package. It can inspect code, architecture, captured artifacts, or the package itself, depending on the selected mode.

TserenTserenov/FMT-exocortex-template · 44 tokens

audit-installation

An audit tool for checking whether an IWE installation is complete, healthy, and consistent with its templates. It reports results for files, customizations, connections, and a basic workflow test.

TserenTserenov/FMT-exocortex-template · 131 tokens

local-llm

A setup and control layer for running language models locally on a Mac with Apple silicon, so data can stay on the computer.

TserenTserenov/FMT-exocortex-template · 78 tokens

evaluating-llms-harness

Evaluates LLMs across 60+ academic benchmarks (MMLU, HumanEval, GSM8K, TruthfulQA, HellaSwag). Use when benchmarking model quality, comparing models, reporting academic results, or tracking training progress. Industry standard used by EleutherAI, HuggingFace, and major labs. Supports HuggingFace, vLLM, APIs.

davila7/claude-code-templates · 85 tokens

ai-workflow

Set up LLM workflow discipline for projects that use AI / LLM calls in production or eval suites. Authors an eval-cost-watcher agent that projects token cost BEFORE regression evals run, plus an AI-workflow-discipline rule covering mock-mode placement, fixture freshness, and multi-stage cost accumulation. Optionally a…

vindm/dotclaude · 88 tokens

skill-trainer

Embeds accumulated triads from quick-learning into target skills as permanent instructions. Reads triads with Adapted=— from triad-index.md, analyzes each skill's existing logic, auto-applies new rules when no coverage exists, proposes refinements when partial coverage found. After embedding, updates Adapted field and…

stepanenkoviktor0110-boop/ai-dev-methodology · 155 tokens