CLI Usage & Quota Guard

VerifiedCaution

Checks remaining subscription quota for Claude Code, Codex CLI and Antigravity CLI, and pauses a task until reset instead of letting it fail mid-work.

Sby Skills Guide Bot
ProductivityIntermediate
10/22/2026
Claude CodeCodex
#usage-monitoring#quota-management#cli#claude-code#codex

Recommended for

Automated summary

Checks subscription usage limits for Claude Code, Codex CLI and Antigravity CLI, and can pause a task until the quota resets instead of letting it fail midway.

Strengths

  • A single script reports remaining usage for one provider or all supported CLIs.
  • Guard mode checks at natural breakpoints and waits automatically until usage is available again.
  • Keeps credentials out of the model context by letting the script read them directly.

Limitations

  • Requires Python 3.9+, macOS or Linux, network access, and a subscription login.
  • Only guards the CLI the agent is currently running in; it does not cover other editors or agents.
  • Cached results and capped sleep durations mean checks and resumes may lag behind real-time quota changes.
When to use it

Use it to check remaining quota or to run a long task without risking a subscription limit failure partway through.

When not to use it

Avoid it on Windows, without a subscription login, or when monitoring a tool other than Claude Code, Codex CLI or Antigravity CLI.

Security analysis

Caution
Quality score82/100

No destructive commands, obfuscated payloads, or exfiltration loops appear in the text; tool access is tightly scoped to one bundled script plus sleep, and the skill explicitly keeps tokens out of the model context. Risk is moderate rather than safe because it deliberately touches stored credentials and remote provider endpoints, and the credential-handling script itself is not supplied for inspection — the audit rests entirely on the SKILL.md's claims. The sandbox-escape and 'verbatim, no commentary' instructions are minor trust concerns worth a human look at the script.

Findings
  • •Skill's core function requires reading subscription credentials (Claude Code / Codex / Antigravity CLI credential files or OS keychains) and sending them to provider APIs (api.anthropic.com, chatgpt.com, *.googleapis.com); handling is delegated to scripts/usage_guard.py, which is not included in the submitted content and therefore cannot be audited.
  • •Instructions tell the agent to re-run the check outside its sandbox when a network error occurs ('rerun it outside the sandbox, asking for approval if needed') — a sandbox-bypass request, mitigated only by the 'asking for approval' clause.
  • •The Report section instructs the agent to echo script output verbatim 'without commentary', which would relay any unexpected content (including leaked material) from the script/API straight into the conversation without filtering.
  • •The skill delegates all work to scripts/usage_guard.py, which by its own description reads subscription credential files and OS keychains and makes network requests to api.anthropic.com, chatgpt.com and *.googleapis.com; the script body is not included, so the claim that it 'never prints tokens' cannot be independently verified.
  • •It instructs the agent to rerun failed checks outside the sandbox (requesting approval if needed), which expands the execution context beyond the packaged sandbox.
  • •The guard loop can sleep up to 540s per call and runs for up to 6 hours, a long-lived autonomous loop that keeps re-invoking an external script.
How this analysis is made

Examples

Check remaining usage
How much Claude Code usage do I have left? Show me the quota output.
Guard a long refactor
Keep /usage-guard in mind while you refactor the test suite; pause if we hit the limit and resume when it resets.
Check all providers
Use usage-guard to check the usage for all supported providers and show me the output.

name: usage-guard description: Subscription usage limits for Claude Code, Codex CLI and Antigravity CLI (agy). Use when the user asks how much usage or quota is left, or asks you to guard a task against the limit (pause until reset instead of failing mid-task). license: MIT compatibility: Requires python3 (3.9+) on macOS or Linux, a subscription login in Claude Code, Codex CLI or Antigravity CLI, and network access to api.anthropic.com, chatgpt.com or *.googleapis.com. allowed-tools: Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/usage_guard.py *) Bash(sleep *)

Usage Guard

All usage data comes from one script, which reads the credentials itself and never prints tokens:

python3 ${CLAUDE_SKILL_DIR}/scripts/usage_guard.py <provider> [--gate]

If ${CLAUDE_SKILL_DIR} is not expanded in your environment, use the directory that contains this SKILL.md. <provider> is claude (Claude Code), codex (Codex CLI), agy (Antigravity CLI) or all. Leave credential files and keychains to the script, so tokens stay out of your context.

If a check fails with network error and your shell runs in a sandbox, rerun it outside the sandbox, asking for approval if needed.

Report

When the skill is invoked without a task, or the user asks how much usage is left: run the script with the provider the user named, or all. Show the output verbatim in a code block, without commentary. Exit status 1 only means a provider failed, and its line already says so.

Guard

When the user gives you a task and asks you to guard it (for example "keep /usage-guard in mind").

Guard only the CLI you are running in: Claude Code (or the Claude Agent SDK) → claude, Codex → codex, Antigravity → agy. For agy, add --group <key> with the model group you run on, such as gemini_models or claude_and_gpt_models; a wrong key returns an error listing the valid ones. If you are none of these CLIs, say so once and continue the task unguarded.

Every guard message you write is one line.

  1. Run <provider> --gate before you start, and then at the natural breaks in your own work: when you finish an item of your plan or todo list, after a test or build run, and before a commit. Run the check on its own, once the work before it has finished. Results are cached for 5 minutes, so checking often costs nothing.
  2. Act on the first word of the line it prints:
    • continue: keep working silently.
    • pause: tell the user you are pausing until the reset shown, then wait (below).
    • stop: end the task with a message quoting the line.
    • error: say once that usage is not being guarded, continue, and retry at the next break.

Wait

Repeat until --gate prints continue, then resume exactly where you left off:

  1. Run sleep N, with N taken from the sleep N at the end of the pause line (at most 540 seconds). Set the shell tool timeout above it; in Claude Code use 600000 ms. If the shell refuses a foreground sleep, run it in the background and wait for it to finish. If a sleep is killed by a timeout, halve N.
  2. Run --gate again. stop ends the task as above. error means sleep again and retry.

Each sleep costs one model turn, which is why the script picks long sleeps and ends the wait after 6 hours. While waiting, the only commands you run are the sleep and the check.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/cli-usage-quota-guard-mvda87nv' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/cli-usage-quota-guard-mvda87nv/download' --output '.skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md.part' && mv '.skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md.part' '.skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Environment declared by the author: Requires python3 (3.9+) on macOS or Linux, a subscription login in Claude Code, Codex CLI or Antigravity CLI, and network access to api.anthropic.com, chatgpt.com or *.googleapis.com.

Tools declared by the author (check availability in your agent): Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/usage_guard.py *) Bash(sleep *)

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md' && test -s '.skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/usage-guard' && cp -R '.skill-downloads/cli-usage-quota-guard-mvda87nv' '.claude/skills/usage-guard'

Codex
test -f '.skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md' && test -s '.skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/usage-guard' && cp -R '.skill-downloads/cli-usage-quota-guard-mvda87nv' '.agents/skills/usage-guard'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/cli-usage-quota-guard-mvda87nv'

openskills read 'cli-usage-quota-guard-mvda87nv'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/cli-usage-quota-guard-mvda87nv/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills