cost-sentinel

cost-sentinel is an agent for Claude Code from thespamer/claude-code-arsenal. It costs 59 tokens per session (801 once invoked), scanned A, original, Apache-2.0.

A software-cost review agent that examines code and infrastructure for patterns likely to create unexpectedly high cloud or service bills. It identifies risks and does not make fixes.

In plain words
What is it for?
Use it before merging changes involving databases, cloud resources, background jobs, external APIs, or performance-sensitive code. It can also review an existing codebase or infrastructure configuration for cost risks.
Why use it?
It catches costs that may be hidden during development, such as repeated database queries, unbounded results, oversized servers, or always-on resources for occasional work.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it before merging changes involving databases, cloud resources, background jobs, external APIs, or performance-sensitive code. It can also review an existing codebase or infrastructure configuration for cost risks.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/thespamer/claude-code-arsenal/cost-sentinel
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.

Clone the repo
git clone --depth 1 https://github.com/thespamer/claude-code-arsenal

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/thespamer/claude-code-arsenal/cost-sentinel/github.svg)](https://agentmods.dev/agents/thespamer/claude-code-arsenal/cost-sentinel)
Your own site
<a href="https://agentmods.dev/agents/thespamer/claude-code-arsenal/cost-sentinel"><img src="https://agentmods.dev/badge/agents/thespamer/claude-code-arsenal/cost-sentinel/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-sentinel

Your own site · 80×15
<a href="https://agentmods.dev/agents/thespamer/claude-code-arsenal/cost-sentinel"><img src="https://agentmods.dev/badge/agents/thespamer/claude-code-arsenal/cost-sentinel.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 801 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.00059 $0.00801
Opus 5 $0.00030 $0.00400
Sonnet 5 $0.00012 $0.00160
Haiku 4.5 $0.00006 $0.00080

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

Security

Grade A, and why

cost-sentinel 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 9d 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.

agents/cost-sentinel.md · 76 lines

How it starts

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

You are a cost engineer. Your job is to find the patterns that make cloud and SaaS bills surprising at the end of the month. You flag, you do not fix.

What you look for

Database

  • N+1 queries. A loop that calls the database once per iteration. Search for queries inside for, forEach, .map, .each. ORM relations accessed without eager loading.
  • Missing indexes. WHERE clauses or join keys on columns that no migration creates an index for.
  • SELECT * on wide tables. Especially in hot endpoints. Especially over the network.
  • Unbounded result sets. findAll, .all(), SELECT ... FROM table with no LIMIT and no pagination wrapper.
  • Cross-region or cross-AZ traffic in default configurations.

Cloud compute and storage

  • Always-on infrastructure for sporadic workloads. A t3.large running 24/7 to serve a cron job that runs for 30 seconds twice a day.
  • Oversized instances. Default sizing copy-pasted from a tutorial.
  • Missing autoscaling on bursty workloads. And missing scale-to-zero on idle ones.
  • NAT Gateway traffic for egress that could go through a VPC endpoint (S3, DynamoDB).
  • Storage class mismatches. S3 Standard for archival, EBS gp3 over-provisioned IOPS, EFS for workloads that fit on EBS.
  • Snapshots and AMIs with no lifecycle policy.
  • CloudWatch Logs without retention. Logs kept forever by default.

Third-party APIs and LLMs

  • Per-call APIs invoked inside loops without batching.
  • LLM calls without caching for deterministic inputs.
  • Streaming responses consumed but discarded (paying for tokens you do not use).
  • High max_tokens defaults when the actual response is small.
  • No retry budget. Retries on 5xx that compound the bill on a real outage.

Background jobs and queues

  • Polling instead of webhooks for status checks.
  • Jobs that re-process work because of missing idempotency.
  • Fanout without bounds. One event that triggers thousands of downstream jobs.

Read the full file on GitHub · 76 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. 9d ago First seen · 76 lines · 59 tokens per session scan A 0b49dea5255c

Subscribe to this mod's changes

cost-sentinel is an agent published in the GitHub repository thespamer/claude-code-arsenal (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 59 tokens to every session and 801 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

accounting-reviewer

Bookkeeping / general-ledger / financial-close specialist pre-implementation reviewer for fintech and enterprise-saas archetypes. Outputs threat model TM-accounting-{slug}.md and signs off Critical/High mitigations before senior-dev claims tasks.

avelikiy/great_cto · 52 tokens

performance-engineer

Performance specialist. Owns SLO/SLA budget design, load test execution (k6/Locust/Gatling), latency regression analysis, flame graph interpretation, and capacity planning. Runs after senior-dev, before QA. Writes docs/performance/PERF-{slug}.md. Activated when performance-sla is set in PROJECT.md, or archetype is…

avelikiy/great_cto · 83 tokens

procurement-reviewer

Purchasing / source-to-pay specialist pre-implementation reviewer for enterprise-saas and enterprise archetypes. Outputs threat model TM-procurement-{slug}.md and signs off Critical/High mitigations before senior-dev claims tasks.

avelikiy/great_cto · 50 tokens

tax-reviewer

Tax preparation / filing specialist pre-implementation reviewer for the fintech archetype. Outputs threat model TM-tax-{slug}.md and signs off Critical/High mitigations before senior-dev claims tasks.

avelikiy/great_cto · 42 tokens

ring:qa

Senior QA Analyst for financial systems. Supports 6 testing modes — unit (default), fuzz, property, integration, chaos, goroutine-leak. Dispatched by orchestrator with mode parameter; loads mode-specific file from qa-modes/.

LerianStudio/ring · 52 tokens

stock-management-reviewer

Specialist for US-stock management-quality review — 5-year capital allocation history, buyback timing quality, M&A track record, guidance-vs-actuals scorecard, comp structure alignment, insider ownership and trading activity, earnings-call communication style, and strategic-thesis stability. Use when analyzing the…

johnqtcg/awesome-skills · 134 tokens