install

An installation procedure for Klag, a tool that monitors Kafka message-processing delay, on a detected Docker, Kubernetes, or GitOps setup.

In plain words
What is it for?
It is for detecting available deployment environments, choosing a demo or real target, installing Klag, checking lag metrics, and optionally setting up its MCP connection.
Why use it?
It helps identify where Klag should run and verifies that Kafka lag—the buildup of messages waiting to be processed—is visible after deployment.

Command

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 commands/themoah/klag/install
Clone the repo
git clone --depth 1 https://github.com/themoah/klag
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,162 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00026 $0.01162
Opus 5 $0.00013 $0.00581
Sonnet 5 $0.00005 $0.00232
Haiku 4.5 $0.00003 $0.00116

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

Security

Grade A, and why

install scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s "$KLAG_URL/readyz"
plugin/commands/install.md · 91 lines

How it starts

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

Set up Klag for the user. Target hint: $ARGUMENTS (may be empty — then detect).

Read ${CLAUDE_PLUGIN_ROOT}/skills/klag/SKILL.md and ${CLAUDE_PLUGIN_ROOT}/skills/klag/references/deploy-targets.md first. Read references/kafka-connect.md once you know the Kafka is not a local plaintext one.

Confirm before every command that mutates the user's machine or cluster, showing the exact command. Detection is read-only and needs no confirmation.

1. Detect

Run the detection block from deploy-targets.md (docker, kube context, helm, ArgoCD/Flux CRDs, Strimzi CRDs, Prometheus Operator CRDs, java). Report what you found in two or three lines.

If the kube context matches prod|production|prd, say so explicitly and get a separate confirmation before touching it.

2. Choose the target

Use AskUserQuestion, ordering options by what you detected. If $ARGUMENTS names a target, skip this step. Options:

  • Demo POC — the repo's docker-compose.yaml: Kafka + Klag + a producer + three misbehaving consumers, so real lag appears in about a minute. Best when the user has no Kafka handy or just wants to see it work. Needs a checkout of themoah/klag.
  • Docker — one container against their Kafka.
  • Kubernetes (Helm) — chart from https://themoah.github.io/klag.
  • GitOps — ArgoCD Application / Flux HelmRelease written to their config repo, not applied.
  • Jar / native image — no docker. The published native build is the themoah/klag:native image; a standalone binary needs a source build with GraalVM JDK 21.

3. Kafka connection

Skip for the Demo POC. Otherwise discover the bootstrap servers rather than asking when you can (Strimzi CR, kubectl get svc -A | grep -i kafka, an existing consumer Deployment's env). Confirm the value with the user either way, then work out the auth from references/kafka-connect.md.

Secrets rule: credentials go into a Kubernetes Secret referenced by kafka.existingSecret. That is the normal path. --set kafka.saslJaasConfig=... is a throwaway-POC shortcut only — it leaves the value in the Helm release and in shell history — so name that trade-off when you use it. Never write credentials into a values.yaml that sits in a git worktree, and never echo them back.

Read the full file on GitHub · 91 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. 2d ago First seen · 91 lines · 26 tokens per session scan A bb7847d0ae35

Subscribe to this mod's changes

install is a command published in the GitHub repository themoah/klag (81 stars, last pushed 2d ago), licensed Apache-2.0. It adds 26 tokens to every session and 1,162 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.