Skip to content
Back to skills

Usage

ASecurity

Show token, request, and cost stats from the troth proxy for the current period.

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 3, 2026
ai-agentsbashgitapi

Works with

  • api
  • mcp

Security analysis

A92/100
  • mediumUses curl or wget to download content

Pro shows the line behind each finding and how to fix it

Scanned September 3, 2026

npx -y skills add xgre1/troth --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/xgre1-usage/badge)](https://www.skillsdirectory.com/skills/xgre1-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: Show token, request, and cost stats from the troth proxy for the current period.
allowed-tools: ["Bash"]
kind: deterministic
---

User wants a usage / cost snapshot. We DO NOT have a substrate tool for proxy stats — they live on the local proxy at http://localhost:8000/api/stats.

Action:

1. Use the `Bash` tool to call: `curl -s http://localhost:8000/api/stats` (if your policy denies Bash, run the curl yourself and paste the output)
2. If the proxy is offline (curl fails), say so plainly — do not invent numbers.
3. If the proxy returned data, surface (in ≤120 words), leading with the WINDOW:
   - **The 5-hour window first** (`persistent_provider_usage.recent_5h.by_model`): per lane — requests and tokens in/out. Subscriptions meter on a rolling ~5h window, so this is the number the operator can act on; 24h and all-time are history.
   - Group by lane, human names: models marked `(plan)` → "Claude plan"; `gpt-*` → "ChatGPT"; `k3`/`kimi*` → "Kimi"; anything else by its model name.
   - Cost estimate $ where rates exist (flat-plan lanes legitimately show $0 — say "plan" instead of a fake price).
   - One line of 24h totals for contrast, dim.
   - Never invent remaining-quota percentages: providers do not expose plan limits; counts are what we honestly know.
4. End with one line on whether usage is on track for the user's stated budget if you can recall it via `engram_search({ query: "monthly budget cost target" })`.

This is a pure read-side surface. No engram writes.

## Tool routing (both topologies)
The substrate tools this skill uses may be DIRECT in your tool list (names like
`troth_engram_record`, `troth_recall`, `troth_dialogue_recent`) OR behind the
troth-router gateway (app installs wire only: troth-router, troth-bash,
troth-cache, troth-hashline). If a named tool is NOT in your tool list, do NOT
conclude the substrate is down and do NOT fall back to file-based memory.
Route it through the router instead:
  1. `mcp_list({server: "troth-substrate"})` (or `"troth-memory"`) to see names.
  2. `mcp_call({server: "troth-substrate", tool: "<same troth_* name>", args: {...same args...}})`.
Substrate lives on server `troth-substrate` (engrams, recall, dialogue, slash);
mind/actions on `troth-memory`. Same tools, same args, one hop through mcp_call.

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.

Comments

Loading comments…