sync-usage

sync-usage is a command for Claude Code from techysy/10router. It costs 32 tokens per session (360 once invoked), scanned A, original, MIT.

A command that exports ZCode model-usage records to 10Router, a service that stores or routes model usage data. It first previews the export and then performs an operation that is safe to repeat.

In plain words
What is it for?
It helps transfer usage records, review the provider breakdown, and report how many records were imported or skipped.
Why use it?
It reduces the risk of sending unexpected records and avoids duplicate imports when the export is run again.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit It helps transfer usage records, review the provider breakdown, and report how many records were imported or skipped.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/techysy/10router/sync-usage
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.

Clone the repo
git clone --depth 1 https://github.com/techysy/10router

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/techysy/10router/sync-usage/github.svg)](https://agentmods.dev/commands/techysy/10router/sync-usage)
Your own site
<a href="https://agentmods.dev/commands/techysy/10router/sync-usage"><img src="https://agentmods.dev/badge/commands/techysy/10router/sync-usage/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 sync-usage

Your own site · 80×15
<a href="https://agentmods.dev/commands/techysy/10router/sync-usage"><img src="https://agentmods.dev/badge/commands/techysy/10router/sync-usage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 360 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.00032 $0.00360
Opus 5 $0.00016 $0.00180
Sonnet 5 $0.00006 $0.00072
Haiku 4.5 $0.00003 $0.00036

Measured yesterday against content hash 466649a9f04d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

sync-usage 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 yesterday.

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.

zcode-plugin/commands/sync-usage.md · 22 lines

What it actually says

Export ZCode model-usage records into 10Router by running the plugin's export script.

Steps:

  1. Determine the mode: if this machine can reach the 10Router endpoint, sync online. If it cannot (different network / no route), export offline: --export zcode-usage.json (no endpoint or credentials needed), tell the user to carry the file to a machine that can reach 10Router, and give them the import command (--import zcode-usage.json --endpoint <URL> --key <sk-…>).
  2. Determine the 10Router endpoint: default http://127.0.0.1:20127; if the user gave an address in $ARGUMENTS (e.g. a NAS IP), use it via --endpoint.
  3. Determine credentials: use --key sk-… (virtual key from 10Router dashboard → API Keys, recommended) or --password. If neither is known, ask the user for one.
  4. Run a dry-run first and summarize what would be exported:
node "$ZCODE_PLUGIN_ROOT/scripts/export-usage.mjs" --endpoint <URL> --key <sk-…> --dry-run
  1. If the dry-run looks right (non-zero rows, sensible provider split), run the real import and report the imported X, skipped Y result. The operation is idempotent — safe to re-run.
  2. If the user writes in Chinese, respond in Chinese.

Arguments (all optional): $ARGUMENTS

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. yesterday Changed · +1 lines · +7 tokens per session 466649a9f04d
  2. 3d ago First seen · 21 lines · 25 tokens per session scan A d7ac1cd03c0e

Subscribe to this mod's changes

sync-usage is a command published in the GitHub repository techysy/10router (25 stars, last pushed today), licensed MIT. It adds 32 tokens to every session and 360 once invoked, about $0.0002 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-09-06.