Borrowing it
Nothing to install: this file belongs to conectlens/lenserfight. 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/conectlens/lenserfight/main/.agents/skills/ai-cost-manager-reducer/SKILL.mdgit clone --depth 1 https://github.com/conectlens/lenserfightWrote 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/skills/conectlens/lenserfight/ai-cost-manager-reducer)<a href="https://agentmods.dev/skills/conectlens/lenserfight/ai-cost-manager-reducer"><img src="https://agentmods.dev/badge/skills/conectlens/lenserfight/ai-cost-manager-reducer/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/skills/conectlens/lenserfight/ai-cost-manager-reducer"><img src="https://agentmods.dev/badge/skills/conectlens/lenserfight/ai-cost-manager-reducer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
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 Output Handling · line 46 Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.Fix: Set explicit limits on output length, generation count, and rate. Use max_tokens and truncation to prevent unbounded output.
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.00098 | $0.02543 |
| Opus 5 | $0.00049 | $0.01272 |
| Sonnet 5 | $0.00020 | $0.00509 |
| Haiku 4.5 | $0.00010 | $0.00254 |
Grade A, and why
ai-cost-manager-reducer 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 10d 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 — 238 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AI Cost Manager & Reducer
Audit as an efficiency engineer, not a summarizer. Every finding must name a concrete waste pattern, its cost risk, and a safe optimization strategy that preserves reasoning quality and chain correctness.
Quick Start
- Identify all AI call sites: LLM API calls, embedding generation, vector search, tool dispatch, agent loops.
- Trace each call's purpose, frequency, input size, output size, and model selection.
- Detect waste patterns (see catalogue below).
- Rank findings by severity and estimated cost impact.
- Propose safe optimizations with validation steps.
Never recommend removing a reasoning step unless you have verified the step is truly redundant or its output is unused downstream.
Audit Scope
AI Call Sites to Inspect
- LLM completions:
openai,@anthropic-ai/sdk, Supabase Edge Functions calling AI APIs, server actions, background workers, cron jobs - Embedding generation:
embeddings.create(),embed(), pgvector insert paths, semantic search pipelines - Vector search: cosine similarity queries,
<=>operator, HNSW/IVFFlat index queries - Tool/function calls: agent tool dispatch loops, multi-step orchestration, MCP tool invocations
- Streaming flows: streamed completions feeding downstream parsers or UI
- Retry logic: exponential backoff, retry-on-failure wrappers, queue consumers
- Caching layers: Redis/KV caches keyed on prompts, memoization wrappers, CDN-cached AI responses
- Classification / extraction calls: sentiment, category, entity extraction, intent detection
- Summarization pipelines: document chunking, recursive summarization, context compression
- Model selection logic: environment switches, tier routing, fallback chains
Waste Pattern Catalogue
Token Waste
| ID | Pattern | Signal |
|---|---|---|
| TW-1 | Oversized system prompt injected on every call | System prompt > 500 tokens with mostly static content |
| TW-2 | Full conversation history resent without truncation | Context grows unboundedly per session |
| TW-3 | Redundant context injection | Same DB rows / user profile fetched and embedded in prompt on every request |
| TW-4 | Verbose output without max_tokens cap |
Responses regularly exceed task requirements |
| TW-5 | Unstructured output where JSON/schema would halve tokens | Free-text response parsed by regex downstream |
| TW-6 | Recursive summarization without memoization | Same document re-summarized on every call |
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.
- 10d ago First seen · 238 lines · 98 tokens per session scan A dc7cbd1d9534
ai-cost-manager-reducer is a skill published in the GitHub repository conectlens/lenserfight (18 stars, last pushed 1mo ago), licensed MIT. It adds 98 tokens to every session and 2,543 once invoked, about $0.0005 per session on Opus 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 skills, from other repositories
ai-ml-development
AI and machine learning development with PyTorch, TensorFlow, and LLM integration. Use when building ML models, training pipelines, fine-tuning LLMs, or implementing AI features.
ai-policy-generator
AI governance policy creation for nonprofits and enterprises with frameworks, risk assessment, ethical guidelines, and compliance templates. Use when drafting AI usage policies, responsible AI frameworks, or organizational AI governance documents.
data-science
Data science and analytics expertise for statistical analysis, machine learning pipelines, data governance, business intelligence, predictive modeling, and analytics strategy. Use when building ML models, analyzing data, creating dashboards, or designing data architectures.
data-engineering
ETL/ELT pipelines, data warehousing (BigQuery, Snowflake, Redshift), stream processing (Kafka, Spark Streaming), orchestration (Airflow, Dagster, Prefect), dbt transformations, and data lake architecture. Use when building data pipelines, designing warehouse schemas, or implementing real-time data processing.
langchain_patterns
Implement Retrieval-Augmented Generation (RAG) systems with LangChain4j. Build document ingestion pipelines, embedding stores, vector search strategies, and knowledge-enhanced AI applications. Use when creating question-answering systems over document collections or AI assistants with external knowledge bases.
langchain_patterns
Implement Retrieval-Augmented Generation (RAG) systems with LangChain4j. Build document ingestion pipelines, embedding stores, vector search strategies, and knowledge-enhanced AI applications. Use when creating question-answering systems over document collections or AI assistants with external knowledge bases.