shadow-test-local-classifier
Skill2 starsChanged 24 days agoMITView on GitHub
Decide whether a small local model can take over a bounded keep/skip or pick-one-of-N task before it touches a cron. Build labelled rows, hold out a split, score per label, test the longest input, then wire it as a fail-open sidecar and review after a week.
In this repository57 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- advisorSkill
- agent-dispatchSkill
- arenaSkill
- audit-pypi-model-packageSkill
- branching-workflowSkill
- code-reviewSkill
- criticSkill
- cron-child-oauth-auditSkill
- daily-forestSkill
- deep-researchSkill
- diagnose-cron-timeoutSkill
- dreamingSkill
- eod-summarySkill
- filingSkill
- forest-synthesisSkill
- goalsSkill
- graph-hygieneSkill
- ideaSkill
- inline-tagsSkill
- intel-analyzerSkill
- longformSkill
- loop-experimentSkill
- loop-librarySkill
- meta-memory-reviewSkill
- office-hoursSkill
- open-loopsSkill
- plan-ceo-reviewSkill
- plan-design-reviewSkill
- prdSkill
- progressive-disclosureSkill
- reality-feedback-createSkill
- reality-review-weeklySkill
- recallSkill
- reconcile-extractionSkill
- redactSkill
- repo-auditSkill
- research-digestSkill
- review-gateSkill
- run-long-job-detachedSkill
- saveSkill
- scopeSkill
- self-auditSkill
- signal-scorerSkill
- skill-auditSkill
- skill-chainingSkill
- spawn-agent-in-tenantSkill
- spawn-tenantSkill
- split-log-rows-by-session-kindSkill
- subagent-delegationSkill
- telegram-dump-routerSkill
- telegram-reply-toolSkill
- verify-stackSkill
- wave-planSkill
- weekly-retroSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Before installing any new model package, run skills/audit-pypi-model-package/SKILL.md.
- Distinctive: line 15
Name the decision and its allowed answers in one line: Write down the volume (rows per day) from a count of stored inputs, not from …
- Distinctive: line 17
Split train and held-out with no overlap: Keep the held-out split out of everything the model sees, including few-shot examples and any …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shadow-test a local classifier on a held-out set
Use when someone asks whether a small local model (a sub-1B fine-tune, a small open-weights instruct model run through Ollama or similar) could replace a Claude step that only chooses from a short fixed list: keep or skip, one of 9 categories, flag or discard. If the answer is free text, or needs a web read or a judgment on new facts, stop: it stays on Claude.
Before installing any new model package, run skills/audit-pypi-model-package/SKILL.md.
Procedure
- Name the decision and its allowed answers in one line. Write down the volume (rows per day) from a count of stored inputs, not from anyone's estimate.
- Build labelled rows from real stored inputs (chat archive, harvested items, feed items) using Claude subagents as teachers. Before trusting a sample, check the input file's modified time and which rows the sample can reach. Example of the trap: a sample drawn only from rows a regex had already kept can expose false positives but never false negatives. Treat a subagent's volume claim as a lead, not a count.
- Split train and held-out with no overlap. Keep the held-out split out of everything the model sees, including few-shot examples and any term list in the prompt. Take the class definition from the labelled rows, not from intuition.
- Score untuned against tuned (or few-shot) on the held-out split, per label. For a minority class report recall and precision, not accuracy: a model can score 93% by always answering the majority label while finding 0 of 10 of the class you care about. A class under about 10% of rows, or a "not on the list" negative label, needs a balanced retry or a yes/no prompt.
- Run at the longest real input and watch memory and context while it runs. Short-prompt tests miss failures that only appear at several thousand tokens (degenerate repeated output), and a runtime's large default context can spill the model to CPU. For thinking models, turn thinking off for short answers and set the context size explicitly.
- Wire it as a shadow: a sidecar log only, Claude's decision unchanged, fail-open, a GPU lock if the GPU is shared, and a kill-switch env var. Add the review date as an intention:
python3 scripts/memory/intentions.py add "review <task> shadow" --due YYYY-MM-DD. Load and unload through one runner so nothing stays resident:scripts/lib/local_models.py. - At the review, compare the sidecar with what the cron actually kept. Use the model to sort, never to drop, while recall on the keep class is under about 80%. Override only the fallback branch (for example keyword defaults) at confidence 0.9 or higher.
Output
A one-page result table (task, rows, held-out size, untuned and tuned score, per-label recall, latency, VRAM) saved to outputs/raw/<persona>/, plus the intentions entry for the review date.
Caveats
- Labels from a Claude teacher measure agreement with the teacher, not truth. Count the rows where every model disagrees with the label: many of those are label noise.
- Calibration matters more than the top score. If the model's confidence at or above 0.9 holds about 95% accuracy on held-out data, an override at that threshold is safe; if it does not, no threshold is.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

