Skip to content
Back to skills

Usage

ASecurity

Token usage and API-equivalent cost of this conversation or all of them (Antigravity Desktop and CLI): tokens, cache, context fill, per-turn breakdown, subagents, plan limits, plus a live side panel. Use when the user asks about tokens, context, cost or limits («сколько потратили», «сколько осталось лимита», /usage, /cost), and on your own when a long conversation may be near its context limit, to decide whether to suggest /handoff.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
developmentpythongobashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add stxrmik/antigravity-plus --skill usage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Usage?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Usage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/stxrmik-usage/badge)](https://www.skillsdirectory.com/skills/stxrmik-usage)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: usage
description: >-
  Token usage and API-equivalent cost of this conversation or all of them (Antigravity Desktop and CLI): tokens, cache, context fill, per-turn
  breakdown, subagents, plan limits, plus a live side panel. Use when the user asks about tokens, context, cost or
  limits («сколько потратили», «сколько осталось лимита», /usage, /cost), and on your own when a long conversation
  may be near its context limit, to decide whether to suggest /handoff.
---

# /usage — token & cost report

> **On your own:** in a long conversation, check the context fill (`usage.py --conversation <id>`, read only the summary). Say nothing unless it's above ~70% (Antigravity compacts as soon as the next call won't fit the window — the report shows the one Antigravity gave the latest call; at release 512k on the Gemini 4 family and Gemini 3.5 Flash-Lite, 256k on Gemini 3.x Flash, 840k on Claude 5.5, 80k on GPT-OSS 120B — or the Antigravity CLI's own `AGY_CLI_AUTO_COMPACT_OVERRIDE` setting, which doesn't exist in the desktop app); then tell the user in one line and suggest /handoff (or their /compact).

The script [usage.py](scripts/usage.py) reads Antigravity transcripts (each model call records
`input_tokens`, `cache_read_tokens`, `output_tokens`) and prices them with [pricing.json](pricing.json).

## Steps

1. **Pick the mode from the user's request:**
   - default → the current session. Your conversation id is in your system context (also the
     `<id>` segment of your artifact directory path).
   - "all", "total", "за неделю", "по дням" → `--all` (add `--days N` if a period is mentioned).
   - If the user names a model to price against ("посчитай как Sonnet"), add `--model <id>` using an `id` from pricing.json.
   - If the user names a Gemini API tier ("по Batch", "Flex", "Priority", "Contributor"), add `--tier <name>` (lower-case); models without that tier in pricing.json stay on Standard.

2. **Run it** (sandboxed first):
   ```bash
   python3 <skill_dir>/scripts/usage.py --conversation <conversation-id> --html <artifact_dir>/usage.html
   ```
   For all sessions:
   ```bash
   python3 <skill_dir>/scripts/usage.py --all --days 7
   ```
   - `--all` and subagent transcripts need read access to the whole `~/.gemini/antigravity/brain/`
     directory. If the output says access is denied (песочница), re-run the **same** command with
     `BypassSandbox: true` — it's read-only.

3. **Present the result:**
   - Paste the script's markdown output **verbatim** (do not recompute or re-round numbers; drop only the trailing `<!-- html: … -->` line).
   - In single-session mode, also embed the dashboard on its own line right after the markdown:
     `<agent-embed src="file://<artifact_dir>/usage.html"></agent-embed>`
   - Then add at most 2–3 short, concrete observations in the user's language, only if useful — e.g. context is above 70% → suggest finishing the task and starting a new conversation; output dominates cost → long generations; low cache hit rate; one subagent dominates cost.
   - End with the link to the live side panel on its own line (it updates every few seconds while the agent works):
     `[Расход токенов](sidecar://antigravity-plus/usage/)`

## Notes
- Costs are an **API-equivalent estimate**, not the user's actual subscription bill.
- The report includes the call that is running `/usage` itself only partially — that's expected.
- If a model shows "Нет цены", add an entry to `pricing.json` (USD per 1M tokens, `match` is a regex on the lower-cased model name). Dated price changes go in `price_changes`, other Gemini API tiers in `service_tiers` — see the Gemini 4 Argon entry.

Files in this skill

  • SKILL.md3.7 KB
  • pricing.json17 KB
  • scripts/usage.py78.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.