klag: Instructions file for Claude Code

CLAUDE.md

klag CLAUDE.md is an instructions file for Claude Code from themoah/klag. It costs 6,612 tokens per session, scanned A, original, Apache-2.0.

A project guide for Klag, a Java service that monitors Kafka consumer lag and exports metrics. It documents build, test, end-to-end testing, and GraalVM native-binary commands.

In plain words
What is it for?
Use it when developing, testing, packaging, or creating a native executable for Klag.
Why use it?
It gives coding agents the project's architecture, required Java setup, and standard commands for building and validating changes.

Instructions file for Claude Code

Written for Claude Code: Claude Code plugin machinery. Also seen: mentions .claude-plugin; mentions CLAUDE.md; mentions Claude Code.

This is themoah/klag's own configuration. It tells Claude Code how to work on klag 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 klag configures →

View source ↗ themoah/klag
Reuse

Borrowing it

Nothing to install: this file belongs to themoah/klag. 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/themoah/klag/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/themoah/klag

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 klag CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/themoah/klag/claude-md/github.svg)](https://agentmods.dev/instructions/themoah/klag/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/themoah/klag/claude-md"><img src="https://agentmods.dev/badge/instructions/themoah/klag/claude-md/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 klag CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/themoah/klag/claude-md"><img src="https://agentmods.dev/badge/instructions/themoah/klag/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,612 This file is loaded in full into every session.
When invoked 6,612 The same file — it is already loaded in full.
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.06612 $0.06612
Opus 5.5 $0.02645 $0.02645
Sonnet 5.5 $0.01322 $0.01322
Haiku 4.5 $0.00661 $0.00661

Measured 16d ago against content hash 8b7c87b9bd61, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

klag CLAUDE.md 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 16d 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.md · 338 lines

How it starts

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

CLAUDE.md

Project Overview

Klag is a Kafka Lag Exporter built with Vert.x 4.5.34. Monitors consumer lag and group states with Prometheus/Datadog/OTLP/StatsD metrics.

Build Commands

# Requires Java 21 - use SDKMAN if needed: sdk use java 21.0.9-tem
# Local: use ./gradlew | CI: uses gradle directly (no wrapper JAR committed)

./gradlew compileJava          # Compile
./gradlew test                 # Run tests
./gradlew assemble             # Package (creates fat JAR)
./gradlew run                  # Run with hot-reload

./scripts/test-helm-chart.sh   # Helm chart template tests (offline)
./scripts/e2e-test.sh          # Full e2e: k3d + real Kafka + chart + lag asserts
./scripts/e2e-strimzi-test.sh  # e2e against Strimzi-operator-managed Kafka (KRaft)
./scripts/e2e-strimzi-matrix.sh # Strimzi e2e across supported Kafka versions

GraalVM Native Image (startup/memory optimized)

Requires a GraalVM JDK 21 (LTS) with native-image (e.g. sdk install java 21.0.2-graalce). Run Gradle with that JDK as JAVA_HOME/GRAALVM_HOME.

gradle nativeCompile           # -> build/native/nativeCompile/klag (standalone binary)
docker build -f Dockerfile.native -t klag:native .   # distroless runtime image
scripts/benchmark-startup.sh native - build/native/nativeCompile/klag  # startup/RSS bench

Native config lives in build.gradle.kts (graalvmNative block) plus reachability hints in src/main/resources/META-INF/native-image/. Reflection metadata for Netty, kafka-clients, logback and micrometer comes from the GraalVM Reachability Metadata Repository (auto-enabled). Entry point is KlagLauncher (direct new MainVerticle(), no reflective Vert.x launcher).

Measured (macOS arm64, prometheus reporter, Kafka up): native ≈ 70-100 ms startup / 44 MB RSS vs JVM 21 ≈ 470-520 ms / 119 MB. JVM 25 (LTS) showed no startup/memory gain over 21 for this workload (slightly higher RSS), so the runtime stays on JDK 21.

Architecture

Vert.x reactive framework with Future<T>-based async API.

Read the full file on GitHub · 338 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. 16d ago Changed · +28 tokens per session 8b7c87b9bd61
  2. 24d ago Changed · +7 lines · +241 tokens per session c4533f55c84a
  3. 1mo ago Changed · +227 tokens per session 3e201915a1df
  4. 1mo ago Changed · +12 lines · +162 tokens per session 22c37f910f6e
  5. 2mo ago Changed · +33 lines · +780 tokens per session 1550b10b210d
  6. 2mo ago First seen · 286 lines · 5,174 tokens per session scan A bfb569197f7d

Subscribe to this mod's changes

klag CLAUDE.md is an instructions file published in the GitHub repository themoah/klag (88 stars, last pushed 5d ago), licensed Apache-2.0. It adds 6,612 tokens to every session, about $0.0264 per session on Opus 5.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.

Related

klag CLAUDE.md compared with instructions from other repositories

klag CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
klag CLAUDE.mdthemoah/klagInstructions file885d agoApache-2.0A6,612Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode