usage-monitor: Skill for Claude Code

.claude/skills/usage-monitor-token-cleanup/SKILL.md

usage-monitor-token-cleanup is a skill for Claude Code from edilsonvilarinho/usage-monitor. It costs 59 tokens per session (1,183 once invoked), scanned A, original, MIT.

A workflow for measuring and reducing the instructions, memory, and skill descriptions loaded into Claude Code for a repository. It estimates context size from file contents and requires evidence and approval before changes.

In plain words
What is it for?
Use it to measure loaded project and global instructions, review cleanup candidates, apply approved changes, and measure again.
Why use it?
It helps find unnecessary context that uses the agent's available input space without removing anything automatically.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

This is edilsonvilarinho/usage-monitor's own configuration. It tells Claude Code how to work on usage-monitor itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything usage-monitor configures →

Reuse

Borrowing it

Nothing to install: this file belongs to edilsonvilarinho/usage-monitor. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/edilsonvilarinho/usage-monitor/main/.claude/skills/usage-monitor-token-cleanup/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/edilsonvilarinho/usage-monitor

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-monitor-token-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/edilsonvilarinho/usage-monitor/usage-monitor-token-cleanup/github.svg)](https://agentmods.dev/skills/edilsonvilarinho/usage-monitor/usage-monitor-token-cleanup)
Your own site
<a href="https://agentmods.dev/skills/edilsonvilarinho/usage-monitor/usage-monitor-token-cleanup"><img src="https://agentmods.dev/badge/skills/edilsonvilarinho/usage-monitor/usage-monitor-token-cleanup/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-monitor-token-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/edilsonvilarinho/usage-monitor/usage-monitor-token-cleanup"><img src="https://agentmods.dev/badge/skills/edilsonvilarinho/usage-monitor/usage-monitor-token-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,183 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.00059 $0.01183
Opus 5.5 $0.00024 $0.00473
Sonnet 5.5 $0.00012 $0.00237
Haiku 4.5 $0.00006 $0.00118

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

Security

Grade A, and why

usage-monitor-token-cleanup 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/measure_context.ps1), 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.

.claude/skills/usage-monitor-token-cleanup/SKILL.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Usage Monitor Token Cleanup

Measure first, propose with evidence, ask item by item, apply only what was approved, measure again. Nothing is changed before the user picks it.

Targets

Target Loaded Path
Project instructions every session CLAUDE.md
Global instructions every session ~/.claude/CLAUDE.md
Memory index every session ~/.claude/projects/<project-key>/memory/MEMORY.md
Memory files on demand same folder, *.md
Skill descriptions every session .claude/skills/*/SKILL.md frontmatter
Skill bodies when invoked .claude/skills/*/SKILL.md

<project-key> is the absolute repo path with :, \ and / replaced by -.

Workflow

  1. Measure. Run the read-only script and keep its output as the baseline:

    powershell -NoProfile -ExecutionPolicy Bypass -File .claude\skills\usage-monitor-token-cleanup\scripts\measure_context.ps1
    

    Tokens are chars / 3.5 — label them as an estimate everywhere; this is not the tokenizer's count.

  2. Analyze. Every finding carries the evidence that justifies it (line numbers, command output, file names). No evidence, no finding.

    • Project CLAUDE.md — it dominates the budget. For each heavy section or first-level bullet the script lists:
      • Narrative that is history, not rule: measurements, "a primeira versão", dated incidents, run ids, how a bug was found. Candidate action: move it to the plan in docs/planos/ that already covers the subject (the script lists linked plans) or to a new docs/<area>.md, and leave in CLAUDE.md the rule in 1–3 lines plus the link. The why must survive in the destination — moving is allowed, deleting a decision is not.
      • Duplication: the same rule stated in two sections, or restating docs/design-system/ / server/README.md. Candidate action: keep one owner, link from the other.
      • Rules the tests already enforce (e.g. ArchitectureRulesTest) can be shortened to the rule plus the test name, never removed.
    • Memory:
      • Broken pointers and orphan files (script output).
      • project_* memories citing issues: run gh issue view N --json state,title for each; a memory whose issues are all closed and whose pending work is done is a candidate for deletion.
      • Memories that duplicate CLAUDE.md, the repo, or git history (the memory rules say not to store those).
      • Memories naming a file, function or flag: Grep for it; if it no longer exists, the memory is stale.
    • Global CLAUDE.md: rules redundant with the project file, or conflicting with it. Report conflicts; never resolve them silently — the global file is the user's personal instruction set.
    • Skills: descriptions over ~300 chars (paid every session), and bodies that repeat CLAUDE.md instead of pointing to it.

Read the full file on GitHub · 69 lines

Files

What ships with it

1 file 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. yesterday Changed · -18 tokens per session fb55f7dcfac4
  2. 8d ago First seen · 69 lines · 77 tokens per session scan A 6b4ba0819a53

Subscribe to this mod's changes

usage-monitor-token-cleanup is a skill published in the GitHub repository edilsonvilarinho/usage-monitor (16 stars, last pushed yesterday), licensed MIT. It adds 59 tokens to every session and 1,183 once invoked, about $0.0002 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-10-16.

Related

Other skills, from other repositories

weekly-digests

Generate a serial week-by-week narrative digest of a project's full claude-mem timeline. Splits the timeline into per-ISO-week files, then runs one consecutive subagent per week — each receiving the prior week's carry-forward block — to produce one chapter per ISO week of data. Use when asked for "weekly digests"…

thedotmack/claude-mem · 93 tokens

cloud-sync

Set up or check claude-mem cloud sync with cmem.ai Pro. Use when the user says "set up cloud sync", "sync my memories", "cmem pro", "cloud backup", "sync status", or wants their memory database backed up or synced to their cmem.ai account.

thedotmack/claude-mem · 64 tokens

screenpipe

Search screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.

thedotmack/claude-mem · 46 tokens

long-context

Extend context windows of transformer models using RoPE, YaRN, ALiBi, and position interpolation techniques. Use when processing long documents (32k-128k+ tokens), extending pre-trained models beyond original context limits, or implementing efficient positional encodings. Covers rotary embeddings, attention biases…

davila7/claude-code-templates · 74 tokens

forget

Remove a personal fact, preference, relationship detail, topic, or prior event from Muse's active memory and stop existing copies or automations from bringing it back. Use for explicit requests such as 'forget that', 'don't remember this about me', or 'remove that from your memory'. Do not use when 'forget it' merely…

asgeirtj/system_prompts_leaks · 74 tokens

hive.note-taking

Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.

aden-hive/hive · 30 tokens