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.
curl -O https://raw.githubusercontent.com/melagiri/code-insights/master/.claude/agents/llm-expert.mdgit clone --depth 1 https://github.com/melagiri/code-insightsWrote 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.
[](https://agentmods.dev/agents/melagiri/code-insights/llm-expert)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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)
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.
- 1mo ago First seen · 142 lines · 417 tokens per session scan A e9103dd02afc
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.
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)…
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.
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".
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…
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.
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.