token-bleed-hunting

token-bleed-hunting is a skill for Claude Code from skyfox675/agents-skills. It costs 329 tokens per session (5,253 once invoked), scanned A, original, MIT.

A method for finding token bleed in AI coding-agent sessions using OpenTelemetry data and local transcripts. Token bleed means spending tokens on repeated context, oversized output, unnecessary prompts, or other work that produces no useful result.

In plain words
What is it for?
Use it to measure waste, compare sessions with a baseline, investigate why tokens were spent, and improve the repository's agent harness configuration without reducing needed capability.
Why use it?
Shared instructions and tool settings can waste tokens in every session, increasing cost and slowing work. The method focuses on confirmed causes and protects instructions and tools that the agent still needs.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it to measure waste, compare sessions with a baseline, investigate why tokens were spent, and improve the repository's agent harness configuration without reducing needed capability.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skyfox675/agents-skills/token-bleed-hunting
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.

Any agent
npx skills add skyfox675/agents-skills --skill token-bleed-hunting
Clone the repo
git clone --depth 1 https://github.com/skyfox675/agents-skills

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 token-bleed-hunting

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/skyfox675/agents-skills/token-bleed-hunting"><img src="https://agentmods.dev/badge/skills/skyfox675/agents-skills/token-bleed-hunting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 329 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,253 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.00329 $0.05253
Opus 5.5 $0.00132 $0.02101
Sonnet 5.5 $0.00066 $0.01051
Haiku 4.5 $0.00033 $0.00525

Measured 27d ago against content hash 6f0c57c87b42, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

token-bleed-hunting 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 27d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/telemetry-query.sh, scripts/transcript-stats.py), 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/token-bleed-hunting/SKILL.md · 196 lines

How it starts

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

Token Bleed Hunting

Every agent session in a repo pays for the same always-loaded context, the same tool definitions, the same instructions, before it does anything. Bleed in that shared layer is a tax on every session, every subagent and every loop tick, forever. A fix there pays back on every session after it merges. That is the leverage this lane exists for.

Token bleed is spend that buys no work: a cache prefix rewritten when it could have been read, a 200 KB test log the agent skims for one line, a top-tier model listing files, a permission prompt re-asked forty times, a session that compacts and then re-reads everything it just forgot. It is not "a lot of tokens". A hard task that spends a lot of tokens well is not bleed.

This skill builds on MODEL-DEFAULTS.md (the tier policy a model-mismatch fix applies), driving-prs-to-merge (PR mechanics) and caveman (its own token discipline). Where a "just make it cheaper" instinct conflicts with the capability rule below, this skill wins.

Project bindings

Project-agnostic; the adopting project defines these in its own CLAUDE.md.

Placeholder Meaning
<owner>/<repo> GitHub repository slug
<integration-branch> Branch fix PRs target
<telemetry-backend> Where OTel lands: prometheus (metrics), loki (events), otlp-file (a collector's file exporter), or sql (ClickHouse or another SQL store behind a collector). Prometheus and Loki are often paired behind one collector. Recipes for each in references/queries.md
<telemetry-access> How the hunter queries it: an HTTP endpoint (direct, or a Grafana datasource proxy), a CLI, or a file path. Credentials come from the environment or a mode-600 file outside the repo, never a file in the repo
<repo-filter> The attribute that tags this repo's sessions. Preferred: vcs.repository.name=<repo>, from OTEL_METRICS_INCLUDE_REPOSITORY=1. Fallback: a custom OTEL_RESOURCE_ATTRIBUTES key such as repo=<repo>. Backends usually turn dots into underscores (vcs_repository_name)
<transcript-root> Where this repo's session transcripts live on the machine running the lane. Absent → metrics-only, and findings carry lower confidence
<window> The analysis window. Default 7d
<baseline-window> The comparison window before it. Default the prior 28d
<min-sessions> Minimum sessions in a window before any number is trusted. Default 20

Read the full file on GitHub · 196 lines

Files

What ships with it

6 files 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. 27d ago First seen · 196 lines · 329 tokens per session scan A 6f0c57c87b42

Subscribe to this mod's changes

token-bleed-hunting is a skill published in the GitHub repository skyfox675/agents-skills (11 stars, last pushed 22d ago), licensed MIT. It adds 329 tokens to every session and 5,253 once invoked, about $0.0013 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-11-06.

Related

token-bleed-hunting compared with skills from other repositories

token-bleed-hunting next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
token-bleed-huntingskyfox675/agents-skillsSkill1122d agoMITA329Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill82ktodayMITA200Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill102ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill396ktodayMITA36Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15kyesterdayCC0-1.0A113Claude Code, Codex
systematic-debuggingobra/superpowersSkill331k5d agoMITA21Claude Code