kafka-consumer-lag

kafka-consumer-lag is a skill for Claude Code from lensesio/agentic-engineering-for-apache-kafka. It costs 84 tokens per session (1,636 once invoked), scanned A, original, MIT.

A tool for investigating consumer lag in Apache Kafka, a system that moves streams of messages between applications. Consumer lag is the number of messages waiting to be processed by a consumer group.

In plain words
What is it for?
Use it to check consumer-group health, investigate slow consumers, track message progress, and produce a lag report with suggested fixes.
Why use it?
It helps identify why Kafka consumers are falling behind, such as slow processing, uneven partition work, or rebalancing.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the kafka-skills plugin — 10 skills shipped together

Good fit Use it to check consumer-group health, investigate slow consumers, track message progress, and produce a lag report with suggested fixes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lensesio/agentic-engineering-for-apache-kafka/kafka-consumer-lag
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 lensesio/agentic-engineering-for-apache-kafka --skill kafka-consumer-lag
Clone the repo
git clone --depth 1 https://github.com/lensesio/agentic-engineering-for-apache-kafka

Made for: Claude Code.

Or install kafka-skills, the plugin that ships this one along with the rest of its 10 skills.

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 kafka-consumer-lag

README.md
[![agentmods](https://agentmods.dev/badge/skills/lensesio/agentic-engineering-for-apache-kafka/kafka-consumer-lag/github.svg)](https://agentmods.dev/skills/lensesio/agentic-engineering-for-apache-kafka/kafka-consumer-lag)
Your own site
<a href="https://agentmods.dev/skills/lensesio/agentic-engineering-for-apache-kafka/kafka-consumer-lag"><img src="https://agentmods.dev/badge/skills/lensesio/agentic-engineering-for-apache-kafka/kafka-consumer-lag/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 kafka-consumer-lag

Your own site · 80×15
<a href="https://agentmods.dev/skills/lensesio/agentic-engineering-for-apache-kafka/kafka-consumer-lag"><img src="https://agentmods.dev/badge/skills/lensesio/agentic-engineering-for-apache-kafka/kafka-consumer-lag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,636 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00084 $0.01636
Opus 5 $0.00042 $0.00818
Sonnet 5 $0.00017 $0.00327
Haiku 4.5 $0.00008 $0.00164

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

Security

Grade A, and why

kafka-consumer-lag 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 12d 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/kafka-consumer-lag/SKILL.md · 188 lines

How it starts

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

Kafka Consumer Lag Analysis

Analyses consumer group lag across all groups and diagnoses potential causes. Consumer lag is the most commonly monitored Kafka metric and the first thing engineers check during incidents.

Target environment: $ARGUMENTS

Workflow

Copy this checklist and track your progress:

Lag Analysis Progress:
- [ ] Step 1: Fetch all consumer groups
- [ ] Step 2: Identify problematic groups
- [ ] Step 3: Diagnose root causes
- [ ] Step 4: Generate report
  1. Fetch all consumer groups with state and lag info
  2. Identify problematic groups (high lag, idle, rebalancing)
  3. Diagnose root causes using partition and throughput data
  4. Report findings with per-group remediation steps

Step 1: Fetch Consumer Groups

Use the Lenses MCP list_consumer_groups tool to get all consumer groups with:

  • Group state (Stable, Rebalancing, Empty, Dead)
  • Lag per topic-partition
  • Active member count
  • Coordinator info

For topic-specific analysis, use list_consumer_groups_by_topic to narrow the scope.

Expected output: List of all consumer groups with state, lag and member count.

Validation: If no consumer groups are returned, report this finding and stop - the cluster may have no active consumers.

Step 2: Identify Problematic Groups

Flag consumer groups in these categories:

Critical

  • Groups in Dead or Empty state with committed offsets (consumer has stopped)
  • Groups with lag growing over time (compare current lag against partition end offsets using get_topic_partitions)

Warning

  • Groups in Rebalancing state (consumption paused)
  • Groups with uneven partition assignment (some consumers have significantly more partitions than others)
  • Groups with no committed offsets (consumer may never have started successfully)

Suggestion

  • Groups with very high member count relative to partition count (idle consumers)
  • Groups consuming from topics with no recent messages (use get_dataset_message_metrics to check producer throughput)

Read the full file on GitHub · 188 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 188 lines · 84 tokens per session scan A 3fc789347ce8

Subscribe to this mod's changes

kafka-consumer-lag is a skill published in the GitHub repository lensesio/agentic-engineering-for-apache-kafka (57 stars, last pushed 21d ago), licensed MIT. It adds 84 tokens to every session and 1,636 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

error-handling-patterns

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

wshobson/agents · 43 tokens

diagnose-backend-bug

Diagnose a bounded backend or multi-service failure from GitHub Issues, Jira, Aone, user-provided exports, logs, traces, responses, stack traces, or job records. Use when a service, API, RPC, worker, queue, CLI, or scheduled job bug needs correlation through the project's existing observability route before repair; do…

QoderAI/better-harness · 87 tokens

error-handling-patterns

Use when picking a failure-reporting strategy — exceptions vs Result types, recoverable vs not, retry / circuit-breaker / graceful degradation — decision framework only, catalogues externalized.

event4u-app/agent-config · 43 tokens

troubleshooting

Systematic backend debugging — reproduce, isolate root cause, implement fix with regression test.

sawrus/agent-guides · 21 tokens

backend-error-handling

Implement error-handling patterns (boundaries, toasts, API error shape). Use when "error boundary", "error toast", or "standardize API errors". Plan-only observability audit → plan-error-handling. Live Sentry triage → debug-sentry-monitor.

kensaurus/cursor-kenji · 60 tokens

debug-fe-be-integration

Diagnose and fix frontend↔backend contract failures by tracing client requests, server logs, validation, auth, and responses on both sides. Use for API 4xx/5xx, mismatched payloads, validation failures, or "frontend and backend disagree". Single-layer errors → debug-error.

kensaurus/cursor-kenji · 66 tokens