cost-optimization

cost-optimization is a skill for Claude Code, Codex from medy-gribkov/arcana. It costs 37 tokens per session (1,467 once invoked), scanned A, original, Apache-2.0.

Guidance for reducing cloud costs by matching infrastructure and software settings to real usage.

In plain words
What is it for?
Use it to right-size containers, evaluate CDN caching, tune databases and serverless workloads, consider spot or reserved capacity, and shorten costly builds.
Why use it?
It helps identify waste from oversized containers, inefficient caching, expensive database queries, poorly tuned serverless functions, and unnecessary build time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to right-size containers, evaluate CDN caching, tune databases and serverless workloads, consider spot or reserved capacity, and shorten costly builds.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/medy-gribkov/arcana/cost-optimization
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 medy-gribkov/arcana --skill cost-optimization
Clone the repo
git clone --depth 1 https://github.com/medy-gribkov/arcana

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin cost-optimization/plugin install cost-optimization after adding the marketplace above.

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 cost-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/medy-gribkov/arcana/cost-optimization/github.svg)](https://agentmods.dev/skills/medy-gribkov/arcana/cost-optimization)
Your own site
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/cost-optimization"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/cost-optimization/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 cost-optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/cost-optimization"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/cost-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,467 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.00037 $0.01467
Opus 5 $0.00018 $0.00733
Sonnet 5 $0.00007 $0.00293
Haiku 4.5 $0.00004 $0.00147

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

Security

Grade A, and why

cost-optimization 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/cost-optimization/SKILL.md · 240 lines

How it starts

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

Container Right-Sizing

Monitor CPU and memory for 7 days before setting limits. Set requests to P50, limits to P99.

BAD: Guessing resource limits. Over-provisioned containers waste money.

resources:
  requests:
    memory: "1Gi"
    cpu: "1000m"
  limits:
    memory: "2Gi"
    cpu: "2000m"

GOOD: Use actual usage data from monitoring.

kubectl top pod myapp-12345 --containers

If P50 is 200Mi/100m and P99 is 400Mi/300m:

resources:
  requests:
    memory: "200Mi"
    cpu: "100m"
  limits:
    memory: "400Mi"
    cpu: "300m"

Vertical Pod Autoscaler

Get sizing recommendations from real workload data.

apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: myapp-vpa
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: myapp
  updateMode: "Off"  # Recommendation mode only

Check recommendations:

kubectl describe vpa myapp-vpa

Cost Calculation

Example: 10 pods running 24/7 with 1Gi memory, 1 CPU.

  • Memory: 10 pods x 1 GiB x $0.0004/hr = $29/month
  • CPU: 10 pods x 1 core x $0.04/hr = $292/month
  • Total: $321/month

Right-size to 200Mi memory, 100m CPU:

  • Memory: 10 pods x 0.2 GiB x $0.0004/hr = $5.80/month
  • CPU: 10 pods x 0.1 core x $0.04/hr = $29.20/month
  • Total: $35/month

Savings: 89% ($286/month)

Horizontal Pod Autoscaler

Scale replicas based on actual load. Do not run excess capacity during low traffic.

BAD: Fixed replica count. Wastes money overnight and weekends.

spec:
  replicas: 10

GOOD: HPA scales from 2 to 10 based on CPU usage.

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: myapp-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: myapp
  minReplicas: 2
  maxReplicas: 10
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70

Cost Impact

Read the full file on GitHub · 240 lines

Files

What ships with it

1 file 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 · 240 lines · 37 tokens per session scan A f22107a5fefe

Subscribe to this mod's changes

cost-optimization is a skill published in the GitHub repository medy-gribkov/arcana (1 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 1,467 once invoked, about $0.0002 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-31.