Home / Claude Code mods / Security / cost-guard

cost-guard

cost-guard is a Claude Code mod by sfrodilla that watches session and daily spend, warns when the context grows large, and holds a prompt once when the prompt cache has expired on a big context.

Updated 2026-10-07

What is cost-guard?

cost-guard is a Claude Code mod by sfrodilla that watches session and daily spend, warns when the context grows large, and holds a prompt once when the prompt cache has expired on a big context. It is listed under Security and has 1 GitHub stars.

TypeClaude code mod
Authorsfrodilla
Repositorysfrodilla/claude-code-mods
Popularity1 GitHub stars
CategorySecurity
SecurityLow risk (88/100)
Rank#2,296 of 5,272 Claude Code mods; #273 in Security
LicenseApache-2.0
Last commit2026-10-07
Hooks4 events
Seesevery prompt
Draws onnothing

Is cost-guard safe to install?

cost-guard scores 88/100 on the MCPMods security check: Low risk. Things to review: watches every prompt or event. It passed 7 of 8 checks.

Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.

CheckResult
No network accessPass
Starts no processesPass
Writes no files or configPass
Doesn't read environment variablesPass
Watches every prompt or eventReview
Doesn't drive ClaudePass
Passes claude plugin validatePass
Has an open-source licensePass

API calls in its code

CallWhat it means
$.clock.after
$.clock.every
$.clock.now
$.command.register
$.prompt.fillwrites the prompt box
$.session.model
$.session.usage
$.store.deletekeeps its own state
$.store.getkeeps its own state
$.store.keyskeeps its own state
$.store.setkeeps its own state
$.ui.statusdraws interface
$.ui.toastdraws interface

How do I install cost-guard?

  1. Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
    claude --version
  2. Read its footprint. This lists every event it hooks and every API call it makes, without running it.
    git clone https://github.com/sfrodilla/claude-code-mods
    claude plugin validate ./claude-code-mods/cost-guard
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add sfrodilla/claude-code-mods && claude plugin install cost-guard@sfrodilla-mods

Or ask Claude to set it up

Paste this into Claude Code and it installs cost-guard for you:

Install the "cost-guard" Claude Code mod from https://github.com/sfrodilla/claude-code-mods/tree/main/cost-guard. Run claude plugin validate on it first and show me what it can access before you enable it.

More from sfrodilla/claude-code-mods

This repository has 2 Claude Code mods on MCPMods.

  • pre-push-review: Reviews unpushed commits against REVIEW_GUIDELINES.md before Claude runs git push (Low risk)