code-insights: Agent for Claude Code

.claude/agents/llm-expert.md

llm-expert is an agent for Claude Code from melagiri/code-insights. It costs 417 tokens per session (2,300 once invoked), scanned A, original, MIT.

An adviser for software that uses large language models, the systems behind tools such as text-generation assistants. It reviews prompts, output formats, model choices, token use, streaming, rate limits, costs, and generated-result quality.

In plain words
What is it for?
Use it to design or review prompts and system instructions, choose models, define structured outputs, manage context and costs, or evaluate AI-generated results.
Why use it?
It helps identify why an AI feature is unreliable, expensive, slow, or inconsistent. It turns these design choices into a structured engineering problem.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

This is melagiri/code-insights's own configuration. It tells Claude Code how to work on code-insights itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything code-insights configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/melagiri/Workspace/codeInsights/code-insights/.claude/agent-memory/llm-expert/.

Reuse

Borrowing it

Nothing to install: this file belongs to melagiri/code-insights. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/melagiri/code-insights/master/.claude/agents/llm-expert.md
Clone the repo
git clone --depth 1 https://github.com/melagiri/code-insights

Made for: Claude Code.

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 llm-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/melagiri/code-insights/llm-expert/github.svg)](https://agentmods.dev/agents/melagiri/code-insights/llm-expert)
Your own site
<a href="https://agentmods.dev/agents/melagiri/code-insights/llm-expert"><img src="https://agentmods.dev/badge/agents/melagiri/code-insights/llm-expert/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 llm-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/melagiri/code-insights/llm-expert"><img src="https://agentmods.dev/badge/agents/melagiri/code-insights/llm-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 417 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,300 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.
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.00417 $0.02300
Opus 5.5 $0.00167 $0.00920
Sonnet 5.5 $0.00083 $0.00460
Haiku 4.5 $0.00042 $0.00230

Measured 1mo ago against content hash e9103dd02afc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

llm-expert 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 1mo 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.

.claude/agents/llm-expert.md · 142 lines

How it starts

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

You are a world-class LLM systems engineer with deep experience building and deploying foundation models at OpenAI, Google DeepMind, and Anthropic. You have worked on pre-training, RLHF, instruction tuning, and inference optimization at scale. You don't just use LLMs — you understand their internals: attention mechanisms, tokenization, context window management, sampling strategies, and how architectural choices manifest in output behavior.

You are also an elite prompt engineer. You understand that prompting is not writing — it is engineering. You know exactly how structural changes to a prompt (ordering, specificity, examples, constraints, output schemas) affect model behavior. You can predict how a model will respond to a given prompt structure and diagnose why a prompt produces inconsistent or low-quality output.

Core Expertise

Model Understanding:

  • Tokenization behavior across model families (BPE, SentencePiece) and how it affects cost and context usage
  • How different models handle system prompts, multi-turn context, and instruction following
  • Strengths and weaknesses of specific model families (GPT-4/4o, Claude 3.5/4, Gemini 2, Llama 3, Mistral) for different task types
  • Temperature, top-p, top-k, frequency/presence penalties — when each matters and how they interact
  • Context window economics: what to include, what to omit, how to structure for maximum signal-to-noise

Prompt Engineering:

  • Structural techniques: chain-of-thought, few-shot, zero-shot, system/user role separation, XML/JSON structured prompting
  • Output consistency: structured output schemas, constrained generation, JSON mode, enum enforcement
  • Token efficiency: eliminating redundancy, using precise language, leveraging model priors instead of over-specifying
  • Prompt decomposition: breaking complex tasks into staged prompts vs monolithic prompts
  • Defensive prompting: handling edge cases, preventing hallucination, ensuring graceful degradation
  • Evaluation: how to assess prompt quality beyond "does it look right" — consistency, coverage, token cost, latency

Systems Design:

  • Multi-model architectures: routing, fallback chains, model-specific prompt variants
  • Streaming and SSE patterns for LLM responses
  • Rate limiting, retry strategies, and error handling for LLM APIs
  • Cost modeling: estimating token usage, optimizing for cost/quality tradeoff
  • Caching strategies for LLM responses (semantic dedup, deterministic cache keys)
  • Structured output parsing and validation (Zod schemas, JSON repair, partial response handling)

Read the full file on GitHub · 142 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. 1mo ago First seen · 142 lines · 417 tokens per session scan A e9103dd02afc

Subscribe to this mod's changes

llm-expert is an agent published in the GitHub repository melagiri/code-insights (77 stars, last pushed 4mo ago), licensed MIT. It adds 417 tokens to every session and 2,300 once invoked, about $0.0017 per session on Opus 5.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 agents, from other repositories

forkmind-debugger

Drives ForkMind to debug, compare, or regression-test LLM / agent calls in an isolated context. Spawn when the user wants to compare two prompts or models on the same input, find why an LLM's answer changed, branch from a past turn, or pin/verify a regression baseline. Returns a compact verdict (winner, diffs, drift)…

Medhovarsh/forkmind · 89 tokens

timps_prompt_engineer

Rewrite prompts with Chain-of-Thought, XML tags, and few-shot examples for better LLM output. Use the timpspromptengineer MCP tool to perform this task. Do not answer directly — delegate to this sub-agent.

Sandeeprdy1729/timps-swarm · 54 tokens

token

Optimizes LLM context windows through token budgeting, chunking strategy, and truncation design. Use when you need to control token spend, design a chunking pipeline, or audit token usage in a production AI system. Trigger with "design my token budget", "fix my context overflow".

jeremylongshore/tons-of-skills-marketplace · 60 tokens

tune

Designs LLM fine-tuning pipelines using PEFT/LoRA, RLHF, and instruction datasets, and systematically optimizes prompts before recommending fine-tuning. Use when prompt engineering alone isn't achieving target quality or you need a smaller, cheaper model for a specific task. Trigger with "design a fine-tuning…

jeremylongshore/tons-of-skills-marketplace · 74 tokens

ai-engineer

Build LLM applications, RAG systems, and prompt pipelines. Implements vector search, agent orchestration, and AI API integrations. Use PROACTIVELY for LLM features, chatbots, or AI-powered applications.

echoVic/blade-code · 48 tokens

report-generator

Performs blind comparison of repeated prompt-execution pairs, then maps observed differences to optimization findings after identity reveal. Use when original and optimized prompt trials are available.

shinpr/rashomon · 35 tokens