usage-guard

usage-guard is a skill for Claude Code from shirley-xue-2025/usage-guard. It costs 75 tokens per session (3,362 once invoked), scanned A, original, MIT.

A usage monitor for long Claude Code sessions. It watches the shared five-hour account limit, which applies across sessions and tabs, rather than only tracking the current session.

In plain words
What is it for?
Use it at the beginning of long, batch, multi-agent, or overnight coding sessions by running the usage-guard command.
Why use it?
It warns you before heavy work risks exhausting the account’s available usage and must be started again for each new sitting.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; mentions Claude Code.

Good fit Use it at the beginning of long, batch, multi-agent, or overnight coding sessions by running the usage-guard command.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shirley-xue-2025/usage-guard/usage-guard
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 shirley-xue-2025/usage-guard --skill usage-guard
Clone the repo
git clone --depth 1 https://github.com/shirley-xue-2025/usage-guard

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 usage-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/shirley-xue-2025/usage-guard/usage-guard/github.svg)](https://agentmods.dev/skills/shirley-xue-2025/usage-guard/usage-guard)
Your own site
<a href="https://agentmods.dev/skills/shirley-xue-2025/usage-guard/usage-guard"><img src="https://agentmods.dev/badge/skills/shirley-xue-2025/usage-guard/usage-guard/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 usage-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/shirley-xue-2025/usage-guard/usage-guard"><img src="https://agentmods.dev/badge/skills/shirley-xue-2025/usage-guard/usage-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,362 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.00075 $0.03362
Opus 5 $0.00037 $0.01681
Sonnet 5 $0.00015 $0.00672
Haiku 4.5 $0.00007 $0.00336

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

Security

Grade A, and why

usage-guard 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.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/arm.sh, scripts/checkpoint.sh, scripts/disarm.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skill/usage-guard/SKILL.md · 210 lines

How it starts

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

usage-guard

Proactive usage guard for long Claude Code sessions (Desktop Code tab or CLI). Invoke once at session start before heavy batch, subagent, or overnight work — especially when the account window is already partly used.

Why account-level monitoring matters

Each Claude session only sees its own usage. The shared 5-hour window is account-level — you can start at 58% in one session while another tab or earlier work already pushed the window to 94%. The daemon polls the OAuth usage API (same as Desktop Settings) so the guard sees the real window, not just this chat's view.

Re-arm every sitting

Arms do not survive Desktop quit, crash, or daemon exit. At the start of every new sitting, run /usage-guard (or /usage-guard resume if continuing a paused task). If arm.sh prints "warning", the previous guard was stale — proceed with the new arm.

If the user mentions usage-guard without /usage-guard

When the user says "use usage-guard", "pay attention to usage limits", or names this skill but does not run the slash command:

  1. Follow this file (you are reading it — treat that as the contract).
  2. Run arm.sh via bash before heavy work (same as ARM MODE below).
  3. Tell the user: /usage-guard is the normal entry point; with disable-model-invocation it may not show in the slash picker — typing /usage-guard still works.

Do not auto-arm on your own initiative without the user asking for usage protection.

When the user invokes /usage-guard

Mode detection

  • If the argument is resume (or starts with resume): RESUME MODE (skip arm, go to section 4).
  • Otherwise: ARM MODE.

1. ARM MODE — start guard

Run:

bash "${CLAUDE_SKILL_DIR}/scripts/arm.sh" {{ARGUMENTS}}

If arm fails, stop and tell the user to run usage-guard doctor in Terminal. Do not start heavy work without a successful arm.

Read ~/.usage-guard/control.json once and confirm:

  • armed: true
  • phase is normal (or five_hour_percent is set) — not stuck on waiting_first_poll without a live daemon
  • If arm JSON output includes "warning", tell the user the prior guard was not active and this is a fresh arm
  • Report go/no-go using arm JSON: five_hour_percent, five_hour_reset_local, seconds_until_five_hour_reset, statenot raw UTC strings
  • If weekly_percent is present (weekly monitoring enabled in config), also report weekly % and weekly_reset_local / seconds_until_weekly_reset. Weekly can trigger PAUSE even when 5h looks safe.
  • If present in control.json, also report extra usage wallet: extra_used_credits, extra_monthly_limit, extra_utilization, extra_currency (amounts are in cents; usage-guard status formats them), or run usage-guard poll for a live snapshot

Read the full file on GitHub · 210 lines

Files

What ships with it

6 files 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. 10d ago First seen · 210 lines · 75 tokens per session scan A fb6f9dae4eb8

Subscribe to this mod's changes

usage-guard is a skill published in the GitHub repository shirley-xue-2025/usage-guard (15 stars, last pushed 1mo ago), licensed MIT. It adds 75 tokens to every session and 3,362 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

g-help

Context-aware help. With no argument, reads current project state and tells you where you are and what to do next, plus a map of every archive. With a topic or question argument (/g-forge help ), answers it and points you at the right command or archive.

onlygian/G-Forge · 62 tokens

g-resume

Re-hydrate a fresh session with the right slice of the durable record. The read-side counterpart to /g-retro — selectively retrieves the relevant retro, ADRs, journal, and handoff keyed by the current branch/milestone/first-task, and assembles a focused re-entry briefing. Loads distilled context into a clean window…

onlygian/G-Forge · 128 tokens

g-voice

Set how G-Forge communicates with you. With no argument, runs a short 2-question intake and sets the right profile automatically — you never need to know the tier names. With dev, mid, or eli5 as an argument, applies that profile directly. Writes .claude/voice-profile. Every G-Forge skill reads this and renders its…

onlygian/G-Forge · 82 tokens

g-listen

Enter listen mode — collect user reports and information without acting, then synthesize and triage when the user signals done.

onlygian/G-Forge · 27 tokens

caveman-help

Quick-reference card for all caveman modes, skills, and commands. One-shot display, not a persistent mode. Trigger: /caveman-help, "caveman help", "what caveman commands", "how do I use caveman".

stevesolun/ctx · 56 tokens

google-apps-script

Build Google Apps Script automation for Sheets and Workspace. Custom menus, triggers (onEdit / time-driven / form submit), dialogs, sidebars, email batches, PDF export, external API. Use whenever the user wants to automate a Google Sheet, build a Sheets menu / sidebar / dialog, hit a Sheets row from email or a…

jezweb/claude-skills · 89 tokens