Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/themoah/klagnpx agentmods add rules/themoah/klag/projectWrote 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/rules/themoah/klag/project)<a href="https://agentmods.dev/rules/themoah/klag/project"><img src="https://agentmods.dev/badge/rules/themoah/klag/project/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.
<a href="https://agentmods.dev/rules/themoah/klag/project"><img src="https://agentmods.dev/badge/rules/themoah/klag/project.svg" alt="Reviewed on agentmods" width="80" 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.00561 | $0.00561 |
| Opus 5.5 | $0.00224 | $0.00224 |
| Sonnet 5.5 | $0.00112 | $0.00112 |
| Haiku 4.5 | $0.00056 | $0.00056 |
Grade A, and why
project 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 2mo 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.
What it actually says
Klag
Kafka consumer lag exporter (Vert.x 4.5.34, Java 21). Monitors lag, velocity, hot partitions, time-based lag, commit freshness, ISR, topic data skew, and group state. Exports to Prometheus, Datadog, or OTLP.
Build
# Java 21 — sdk use java 21.0.9-tem
./gradlew compileJava # compile
./gradlew test # unit tests
./gradlew assemble # fat JAR
./gradlew run # hot-reload dev
./scripts/test-helm-chart.sh # Helm template tests (offline)
./scripts/e2e-test.sh # k3d + real Kafka e2e
./scripts/e2e-strimzi-test.sh # Strimzi/KRaft e2e
CI uses gradle directly (wrapper JAR is not committed). Local dev uses ./gradlew.
Native image: GraalVM JDK 21 + gradle nativeCompile → build/native/nativeCompile/klag. Entry point is KlagLauncher (no reflective Vert.x launcher).
Layout
src/main/java/io/github/themoah/klag/
├── MainVerticle.java # HTTP router, lifecycle
├── config/ # AppConfig, Env
├── health/ # probes, version
├── kafka/ # KafkaClientService[Impl]
├── metrics/ # collector, reporter, velocity/hotpartition/timelag/dataskew
├── mcp/ # read-only MCP snapshot tools
└── model/ # Java 21 records
HTTP endpoints
| Path | Purpose |
|---|---|
/healthz |
Liveness (always 200) |
/readyz |
Readiness (200 if Kafka up) |
/metrics |
Prometheus scrape |
/version |
Build info |
/mcp |
MCP JSON-RPC (if MCP_ENABLED=true) |
Code style
- Async APIs return
Future<T>; use Java 21 records for DTOs - SLF4J + Logback; no stdout from application code
- Config precedence: classpath
application.properties→KLAG_CONFIG_FILE→ env vars - Bump version in
build.gradle.ktsafter minor/major changes - Minimize diff scope; match existing patterns; no drive-by refactors
Full env var and metric reference: CLAUDE.md.
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.
- 2mo ago Changed d692d072254f
- 2mo ago Changed · +7 tokens per session aff7f11af690
- 3mo ago First seen · 60 lines · 554 tokens per session scan A 17cdd078d011
project is a cursor rule published in the GitHub repository themoah/klag (88 stars, last pushed yesterday), licensed Apache-2.0. It adds 561 tokens to every session, about $0.0022 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.
project compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| projectthemoah/klag | Cursor rule | 88 | yesterday | Apache-2.0 | A | 561 | Cursor |
| gosupertokens/create-supertokens-app | Cursor rule | 24 | 5d ago | Apache-2.0 | A | 0 | Cursor |
| zpa-dependency-chainzscaler/zscaler-mcp-server | Cursor rule | 56 | 15d ago | MIT | A | 136 | Cursor |
| codinfy-agent-monitorbakalagoin/codinfy-agent-monitor | Cursor rule | 1 | 5mo ago | none | A | 181 | Cursor |
| ponytailDietrichGebert/ponytail | Cursor rule | 203k | 10d ago | MIT | A | 604 | Cursor |
| angular-20angular/angular | Cursor rule | 102k | today | MIT | A | 0 | Cursor |
| dev-standardapache/superset | Cursor rule | 76k | today | Apache-2.0 | A | 1,147 | Cursor |