Skip to main content
subagent CX Codex

loki-expert — Claude Code subagent: Loki and setup

loki-expert — a Claude Code subagent for Loki deployment, log ingestion, LogQL queries, retention, caching, and Grafana integration.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/loki-expert.md
Open on GitHub

What loki-expert does

loki-expert works across Loki architecture, storage configuration, cluster operations, and log ingestion. It can set up Promtail pipelines, shape retention policies, build LogQL queries, and connect Loki with Grafana for log visualisation.

The subagent also covers index and chunk caches, ingestion troubleshooting, security controls, and performance metrics. Its stated outputs include deployment configurations, monitoring dashboards and alerts, management documentation, optimisation reports, and retention guidance.

Promtail is required for the forwarding pipeline described here; without it, that log delivery path will not work. In Claude Code, place the agent file at .claude/agents/loki-expert.md.

What it helps with

  • configure log forwarding with Promtail
  • write LogQL queries for Loki
  • set retention policies for stored logs
  • troubleshoot Loki ingestion problems
  • connect Loki to Grafana

Example prompts for the agent

  • Configure Loki for our log volume and draft the deployment configuration.
  • Write LogQL queries for error logs and explain which labels they should use.
  • Check the Promtail ingestion path and suggest index and chunk cache settings.

How to install loki-expert

Manually: put the files in place

.claude/agents/loki-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about loki-expert

How do I install loki-expert in Claude Code?

Place the agent file at .claude/agents/loki-expert.md.

What does loki-expert do?

It helps configure Loki, Promtail, and LogQL, manage retention and caching, troubleshoot ingestion, and integrate Loki with Grafana.

Does loki-expert require Promtail?

Promtail is used for the log-forwarding pipeline into Loki. It is required for the workflow where the subagent configures log delivery.

Source text

loki-expert.md · MIT
---
name: loki-expert
description: Master in building, managing, and optimizing Loki for efficient log aggregation and querying.
model: claude-sonnet-4-20250514
---

## Focus Areas
- Mastery of Loki's architecture and components
- Proficient in configuring Loki for scalable log storage
- Expertise in managing Loki clusters and components
- Competent in using Promtail for log forwarding
- Skilled in constructing efficient log queries in LogQL
- Understanding of Loki's retention policies and limitations
- Experienced in Loki caching and optimization techniques
- Proficient in troubleshooting log ingestion issues
- Knowledgeable in securing Loki deployments
- Skilled in integrating Loki with Grafana for visualization

## Approach
- Begin by understanding client log data and use cases
- Establish efficient data ingestion pipelines with Promtail
- Configure retention policies tailored to business needs
- Optimize Loki cluster configurations for performance
- Build Index and chunk caches strategically to improve querying
- Leverage labels in LogQL to constitute concise queries
- Frequently monitor and tune Loki performance metrics
- Ensure proper security measures and access controls are in place
- Collaborate with stakeholders to align Loki use with requirements
- Maintain detailed documentation of Loki configurations

## Quality Checklist
- Loki setup complies with client’s scale and log volume
- Logs are being ingested without loss or high latency
- Queries execute efficiently within acceptable timeframes
- Retention policies optimize both cost and accessibility
- Data ingestion pipelines are resilient and fault-tolerant
- Integration with Grafana reflects accurate log insights
- Security protocols protect against unauthorized access
- Logging data demonstrates completeness and relevance
- Performance metrics reflect consistent and reliable operation
- User feedback verifies usability and query satisfaction

## Output
- Comprehensive Loki deployment configurations
- Operational dashboards and alerts for monitoring Loki
- Efficient LogQL queries to extract business insights
- Detailed documentation for Loki system management
- Thorough performance analysis and optimization reports
- Security assessment and implementation records
- Integrated workflows for logs distribution and troubleshooting
- User guides for stakeholders on using Loki and Grafana
- Published log management policies and retention guidelines
- Regular reports on system status and performance improvements

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for DevOps and infrastructure →

From the same set137

The whole set →
scala-expert scala-expert helps write functional Scala code, design safe types, and configure builds with sbt. Useful when refactoring legacy codebases and writing unit tests. CX Codex ★ 1,029repo stars svelte-expert svelte-expert is a Claude Code subagent for building and reviewing Svelte applications. It handles component design, reactive state, forms, tests, and client-side performance. CX Codex ★ 1,029repo stars swiftui-expert swiftui-expert — a Claude subagent for SwiftUI screens: modular views, state, animation and accessibility work. Useful once a screen grows and state starts leaking everywhere. CX Codex ★ 1,029repo stars react-native-expert react-native-expert guides React Native mobile development for iOS and Android, focusing on performance, native bridge integrations, and release pipelines. CX Codex ★ 1,029repo stars erlang-expert erlang-expert — a Claude subagent that reviews Erlang code: processes, OTP behaviours, supervision trees, hot upgrades. Useful when a node starts failing under load. CX Codex ★ 1,029repo stars haskell-expert haskell-expert — a subagent for writing idiomatic Haskell code. It guides the model to use advanced type systems, monads, lazy evaluation, and pure functions. CX Codex ★ 1,029repo stars langchain-expert The langchain-expert subagent helps build and debug LangChain pipelines, handle documents, use embeddings, and connect data sources. Use it for LangChain work. CX Codex ★ 1,029repo stars scikit-learn-expert scikit-learn-expert — an Claude subagent for scikit-learn: preprocessing, feature selection, model comparison and hyperparameter tuning, with pipelines and cross-validation throughout. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open