scale-canary

scale-canary is a skill for Claude Code from HetCreep/CoalMine. It costs 85 tokens per session (1,896 once invoked), scanned A, original, Apache-2.0.

A performance audit for finding code that may slow down or consume too many resources as data grows. It checks nested loops, repeated database queries, growing collections, blocking work, and unclosed resources.

In plain words
What is it for?
It is for auditing quadratic loops, database N+1 queries, memory leaks, blocking main-loop calls, and leaked streams, connections, or handles.
Why use it?
It helps reveal scalability problems that may only appear with larger workloads or longer-running processes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions subagents; names the AskUserQuestion tool.

Part of the coalmine plugin — 9 skills shipped together

Good fit It is for auditing quadratic loops, database N+1 queries, memory leaks, blocking main-loop calls, and leaked streams, connections, or handles.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hetcreep/coalmine/scale-canary
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 HetCreep/CoalMine --skill scale-canary
Clone the repo
git clone --depth 1 https://github.com/HetCreep/CoalMine

Made for: Claude Code.

Or install coalmine, the plugin that ships this one along with the rest of its 9 skills.

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 scale-canary

README.md
[![agentmods](https://agentmods.dev/badge/skills/hetcreep/coalmine/scale-canary/github.svg)](https://agentmods.dev/skills/hetcreep/coalmine/scale-canary)
Your own site
<a href="https://agentmods.dev/skills/hetcreep/coalmine/scale-canary"><img src="https://agentmods.dev/badge/skills/hetcreep/coalmine/scale-canary/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 scale-canary

Your own site · 80×15
<a href="https://agentmods.dev/skills/hetcreep/coalmine/scale-canary"><img src="https://agentmods.dev/badge/skills/hetcreep/coalmine/scale-canary.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,896 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.00085 $0.01896
Opus 5 $0.00043 $0.00948
Sonnet 5 $0.00017 $0.00379
Haiku 4.5 $0.00009 $0.00190

Measured 5d ago against content hash cb6109b876db, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

scale-canary 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 5d ago.

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.

plugin/skills/scale-canary/SKILL.md · 78 lines

How it starts

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

Scale Canary (Performance & Resource Allocation Audit)

Language: Generate EVERYTHING at runtime in the user's language — questions, answer options, menu labels, recommendations, report narrative. Detect from their messages; never default to English just because this file is English. English is allowed only for technical terms: commands, paths, code identifiers, severity labels (CRITICAL/HIGH/MEDIUM/LOW), and tier names (Light/Standard/Heavy).

Config reads — every config key, always the CASCADE, never the bare project file: ~/.claude/.coalmine.json first, then the project config (own agent dir → other known agent dirs → legacy <gitroot>/.coalmine.json), project wins per key. A bare project read is ABSENT on a machine configured only globally, so it silently yields defaults.

Audit code for scalability issues, performance bottlenecks, and resource leaks.

Auditing Categories

  1. O(N^2) Complexity — nested loops over growable collections without indexing or caching (crashes at scale).
  2. N+1 Database Queries — querying records in a loop instead of a batch JOIN or bulk prefetch.
  3. Memory Bloat / Leaks — appending to global arrays/maps without clearing them → unbounded growth.
  4. Blocking Main Loop — synchronous FS ops or CPU-heavy work on the main event thread (lag/hangs).
  5. Resource Leakage — streams, connections, or handles left open without a finally close.

Per-ORM N+1 shapes, per-stack blocking patterns, and what NOT to flag: read references/checks.md before scanning.

Fix mode (choice-gated)

In Agent Context, after the report, present via ask_question:

  • Apply safe optimizations: async-ify synchronous file ops; insert finally blocks for stream closing. Each fix: checkpoint (git stash/commit in a git repo; else copy the file aside — never assume git) → apply → build + tests → auto-revert if newly red.
  • Let me pick: user selects specific optimizations.
  • Report only: exit unchanged.

Grants & denials (CLASSIFY-BLOCK)

class step it powers grant on denial
read scan loops/queries/caches for the categories above Read·Grep·Glob refuse that file, name it — never a clean bill
write Fix mode's safe-optimization apply, incl. checkpoint → build+tests → auto-revert if newly red Edit·Bash (checkpoint/build/revert need exec) report the fix as NOT applied AND the checkpoint/revert as NOT available, never claim done

Read the full file on GitHub · 78 lines

Files

What ships with it

3 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. 5d ago Changed · +2 lines cb6109b876db
  2. 9d ago First seen · 76 lines · 85 tokens per session scan A 0aa310597038

Subscribe to this mod's changes

scale-canary is a skill published in the GitHub repository HetCreep/CoalMine (12 stars, last pushed yesterday), licensed Apache-2.0. It adds 85 tokens to every session and 1,896 once invoked, about $0.0004 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-08-30.

Related

Other skills, from other repositories

performance-audit

Full-stack performance health check across 12 dimensions. Rendering, bundles, assets, API/network, algorithms, memory, database, caching, Web Vitals, backend runtime, concurrency, and framework-specific pathologies. Evidence-based Impact Models with confidence tiers and a prioritized optimization roadmap. Switches…

greglas75/zuvo · 90 tokens

hermes-mnemosyne

Mnemosyne is Hermes' primary local-first memory engine — SQLite with vector + FTS5 hybrid search, 19+ tools, auto-consolidation, and a standalone CLI. It's a pip-installed plugin (not a built-in toolset) discovered via $HERMESHOME/plugins/mnemosyne/.

AtlasOmnia/donna-starter · 30 tokens

doris-repo-review

Review an Apache Doris PR from a local clone with the same multi-agent, shared-ledger convergence workflow as the CI Code Review Runner. Use when the user supplies a PR to /doris-repo-review, asks to review a Doris PR locally, or asks for the CI-style review flow. Safely align only the current worktree to the exact PR…

apache/doris-skills · 180 tokens

doris-debug-resource-isolation

Use for Doris Workload Group / resource tag queue starvation, CPU/memory isolation leaks, and workload policy debugging. Commands: SHOW WORKLOAD GROUPS, EXPLAIN resource.

apache/doris-skills · 43 tokens

gossipcat

Use when installing or setting up gossipcat multi-agent orchestration (parallel review, consensus, adaptive dispatch) in Claude Code or Cursor. Installs the gossipcat MCP server and hands off to gossipstatus() for all live rules.

gossipcat-ai/gossipcat-ai · 50 tokens

db-audit

Database performance and safety audit. 70+ checks across 13 dimensions (DB1-DB13): query patterns, indexes, schema design, connections, transactions, migrations, caching, query optimization, ORM anti-patterns, observability, data lifecycle, DB security, and migration deployment safety. Code-level checks for all ORMs.…

greglas75/zuvo · 115 tokens