loki

loki is a skill for Claude Code, Codex from ashish7802/awesome-api-skills. It costs 0 tokens per session (534 once invoked), scanned A, original, MIT.

A guide to Grafana Loki, a system for collecting and querying application logs. It groups logs by labels such as application and environment instead of indexing every word.

In plain words
What is it for?
Running Loki, shipping Kubernetes logs with Promtail, filtering logs with LogQL, and handling ordering problems in distributed systems.
Why use it?
It helps centralize logs at lower storage cost, while making clear that it is not designed for complex fuzzy full-text searches.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Running Loki, shipping Kubernetes logs with Promtail, filtering logs with LogQL, and handling ordering problems in distributed systems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashish7802/awesome-api-skills/loki
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 ashish7802/awesome-api-skills --skill loki
Clone the repo
git clone --depth 1 https://github.com/ashish7802/awesome-api-skills

Made for: Claude Code, Codex.

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 loki

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/loki.svg)](https://agentmods.dev/skills/ashish7802/awesome-api-skills/loki)
Your own site
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/loki"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/loki.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 534 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 18
    Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
    Fix: Pin the image: image:tag or image@sha256:abc123
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.00000 $0.00534
Opus 5 $0.00000 $0.00267
Sonnet 5 $0.00000 $0.00107
Haiku 4.5 $0.00000 $0.00053

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

Security

Grade A, and why

loki 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 8d 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/loki/SKILL.md · 62 lines

How it starts

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

Loki Skill

Like Prometheus, but for logs.

Ecosystem Graph

graph LR
  loki["Loki"]
  loki -- "depends on" --> grafana
  loki -- "works well with" --> prometheus

Quick Start

Loki aggregates logs but, unlike Elasticsearch, it only indexes metadata labels rather than the full text of the log. This makes it insanely cheap and fast to operate.

docker run -d -p 3100:3100 grafana/loki

Production Patterns

LogQL vs Full Text

Do not expect to do complex full-text fuzzy searching natively. Loki forces you to filter by labels first (e.g., {app="backend", env="prod"}), and then it aggressively scans the chunks of text that match those labels.

Architecture & Scaling

Promtail

Loki requires an agent to ship logs. Promtail is the official agent. Deploy Promtail as a DaemonSet in Kubernetes to automatically scrape all pod stdout logs and forward them to the centralized Loki instance.

Error Recovery

Loki will actively reject logs if they are sent out of chronological order (a common issue in highly distributed systems). Ensure you configure unordered_writes: true in your Loki configuration to mitigate this.

Security Notes

Do not inject dynamic, unbounded user data (like session IDs or IPs) as Loki Labels. This causes Cardinality explosions, crashing the system. Log the dynamic data in the text payload, and only label static data (app name, region, environment).

Relationships

Prerequisites: grafana

Works Well With: prometheus

References

Why use this skill

Use this when your agent works with loki — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Using outdated SDK or API versions from training data
  • Inventing environment variable names
  • Omitting error handling and retry logic

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Read the full file on GitHub · 62 lines

Files

What ships with it

2 files 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. 8d ago First seen · 62 lines · 0 tokens per session scan A 8f39491fcdc5

Subscribe to this mod's changes

loki is a skill published in the GitHub repository ashish7802/awesome-api-skills (13 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 534 tokens. 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

ios-simulator

Verify and debug native, React Native, Expo, or Flutter apps on an iOS Simulator with agent-device. Use when an agent needs to launch an app, inspect its live UI, tap, type, scroll, validate a code change, collect failure evidence, or reproduce a workflow on an iPhone or iPad Simulator.

callstack/agent-device · 69 tokens

manage-skills

A maintenance workflow for checking whether project verification skills still cover the code and rules that changed during a session.

sangrokjung/claude-forge · 54 tokens

systematic-debugging

Structured debugging methodology — use before proposing fixes for any error or failure. Covers: code bugs, build errors, deploy failures, config conflicts, dependency issues, infra problems. Also use when previous fix attempts failed or root cause is unclear.

sangrokjung/claude-forge · 53 tokens

review-loop

Run the adversarial verification loop — implement, then hand the change to a fresh checker that did not write it, fix what it finds, and re-dispatch until APPROVE. Use before claiming any behavioural change is done, and on requests like "review loop", "adversarial review", "independent review", "get this verified"…

sangrokjung/claude-forge · 100 tokens

iii-error-handling

Handle iii engine and SDK errors across Node, Python, Rust, and browser workers. Use when interpreting error codes, retryability, RBAC denial, timeouts, handler failures, or SDK-specific exception surfaces.

iii-hq/iii · 47 tokens

debug

Systematic debugging with MCP integration, auto-invoke from qa-commit, Phase 7 Harden.

WellApp-ai/Well · 21 tokens