/gabbe-extras:agent-analyticsfrom gabbe-extras
Logs token use, task duration, and retries per task to a metrics file. Detects retry loops and cost spikes. Useful for monitoring agent efficiency and debugging runaway tasks.
Ships in gabbe-extras. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Provide visibility into the "Black Box" of agent execution by tracking cost (tokens) and efficiency (time/loops).
Input: Completion of a Task / Tool Call / Phase. Action: Log the following structured data:
timestamp: ISO 8601agent_id: Loki / Claude / Geminitask_id: T-NNNtokens_in: (Estimated)tokens_out: (Estimated)duration_ms: execution time, only if the platform reports it; otherwise leave it empty (do not guess)status: SUCCESS | FAILURE | RETRYtask_id appears > 5 times in agents/memory/metrics/analytics.jsonl with status: RETRY, trigger human_escalation.tokens_out > 5000 for a simple task, flag as "Verbose/Inefficient".When: on request, and at the end of each S11 or S12 cycle.
Output: agents/memory/metrics/report.md, computed from analytics.jsonl with a script (jq or Python), not estimated by hand.
agents/memory/metrics/analytics.jsonl (Append-only log)The metrics above are reactive — they detect overruns after tokens are already spent. Admission control is proactive: a financial-middleware gate sits in front of every premium-model call, tool call, and subagent spawn and decides, BEFORE the step runs, whether the budget can afford its worst case. A step that cannot be afforded is rejected at the gate and never enters the loop, so a runaway plan is stopped before it costs anything rather than after.
reserve(amount) (backed by can_afford(amount)). Without the CLI this check is advisory: compare the estimate with the budget the human gave you and ask before going over it.Admission estimates are derived from the model's own (non-deterministic, gameable) reasoning, so they should sit on top of a deterministic floor: hard counters enforced by the platform or the CLI, outside the agent's control. The kit itself does not provide them; if your platform has token, turn or time limits, set them:
These counters are authoritative: the agent's non-deterministic logic cannot talk its way past them, because they are checked by the runtime, not the model. The probabilistic estimator decides whether to attempt a step; the deterministic floor decides when to stop no matter what.
One JSON line per task in agents/memory/metrics/analytics.jsonl (fields above) and, on request, agents/memory/metrics/report.md with total tokens, average duration and first-pass success rate.
analytics.jsonl.reserve, can_afford) works only when the CLI calls it. If your platform provides budget limits or hooks, use them as the hard stop.What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/emerging-techGives design guidance and a short plan for 6G edge placement, Matter IoT devices and vector search with RAG. Use when a design involves low-latency edge compute, smart-home devices, embeddings or semantic search./empirical-methodsDesigns a measurement or experiment (metric, hypothesis, controls, sample size) and reports results with effect size and confidence interval. Use when comparing benchmarks, reading A/B results, choosing a metric or tracing a root cause./knowledge-connectConnects the agent to documentation, project files and vector stores and sets up retrieval with a fallback chain. Use when the human wants to index project docs, set up a RAG pipeline, or query a knowledge base.npx claudepluginhub andreibesleaga/gabbe --plugin gabbe-extrasOther plugins' skills for the same job