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.5 $0.00030 $0.01345
Sonnet 5.5 $0.00015 $0.00672
Haiku 4.5 $0.00007 $0.00336

Measured 1mo ago against content hash fb6f9dae4eb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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, state — not 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. 1mo 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 3mo ago), licensed MIT. It adds 75 tokens to every session and 3,362 once invoked, about $0.0003 per session on Opus 5.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

poteto-help

Guides users through pstack setup, /poteto-mode, and picking the skill, playbook, or principle for a task. Type /poteto-help with a question.

michael-denyer/pstack-claude · 40 tokens

ketchup

Catch the user up on what changed in this chat since their last message, in plain words and small visuals. List every item waiting on them with what they need to decide it from the reply alone. Use for /ketchup.

michael-denyer/pstack-claude · 49 tokens

sharpen

Make a task deeper, not bigger, then rewrite the prompt. Use for /sharpen.

michael-denyer/pstack-claude · 24 tokens

timeboxed-iterating

Run a task iteratively over a user-specified duration by dispatching subagents. The orchestrator stays strictly linear and time-checked, but each iteration fans out MULTIPLE subagents in parallel over independent units (and those subagents may fan out further). Shared state — a compact progress digest and a growing…

av/skills · 239 tokens

find-plugin-file

This skill should be used when needing to locate files within the Claude Code plugins cache directory (/.claude/plugins/cache). Triggers include finding tool scripts, skill files, or any plugin resource when the hardcoded path is unknown or varies by plugin version. Use when slash commands or orchestrators need to…

closedloop-ai/claude-plugins · 70 tokens

agent-teams

Multi-agent team orchestration with native Agent Teams. Trigger when the user wants to launch a team of agents, coordinate parallel work with inter-agent communication, or use swarm mode.

christopherlouet/claude-base · 39 tokens