Home / Claude Code mods / Security / cost-guard

cost-guard

cost-guard is a Claude Code mod by tgralex that holds a message that would cost more than your token or dollar limit (cold prompt cache or a very large message), explains why, and asks before sending. Can also keep the cache warm during.

Updated 2026-10-14

What is cost-guard?

cost-guard is a Claude Code mod by tgralex that holds a message that would cost more than your token or dollar limit (cold prompt cache or a very large message), explains why, and asks before sending. Can also keep the cache warm during. It is listed under Security and has no public popularity data yet.

TypeClaude code mod
Authortgralex
Repositorytgralex/claude-mods
Popularityno public popularity data yet
CategorySecurity
SecurityReview before installing (68/100)
Rank#8,740 of 9,397 Claude Code mods; #884 in Security
Last commit2026-10-14
Hooks7 events
Seesevery prompt
Draws onAbovePrompt

Is cost-guard safe to install?

cost-guard scores 68/100 on the MCPMods security check: Review before installing. Things to review: reads environment variables; watches every prompt or event. It passed 4 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
Reads environment variablesReview
Watches every prompt or eventReview
Drives Claude (model calls, prompts)Note
Passes claude plugin validatePass
No license detectedNote

API calls in its code

CallWhat it means
$.clock.every
$.clock.now
$.command.register
$.env.getreads env vars
$.model.forkdrives Claude
$.prompt.fillwrites the prompt box
$.prompt.submitdrives Claude
$.session.id
$.session.model
$.session.usage
$.settings.readreads settings
$.state.get
$.state.set
$.store.deletekeeps its own state
$.store.getkeeps its own state
$.store.setkeeps its own state
$.ui.logdraws interface
$.ui.resolvedraws interface
$.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/tgralex/claude-mods
    claude plugin validate ./claude-mods/mods/cost-guard
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add tgralex/claude-mods && claude plugin install cost-guard@claude-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/tgralex/claude-mods/tree/main/mods/cost-guard. Run claude plugin validate on it first and show me what it can access before you enable it.

More from tgralex/claude-mods

This repository has 2 Claude Code mods on MCPMods.

  • read-aloud: Reads Claude's replies and plans aloud, whole or just the text you selected, with a Stop button while it reads. (Review before installing)