muffliato-hookus
Skill9 starsChanged 3 months agoMITView on GitHub
Measure and reduce per-prompt hook injection — the context every hook adds to every turn (SessionStart, UserPromptSubmit, PostToolUse, Stop advisories). Ranks emitters by tokens injected, finds false-positive matchers (bad keyword regexes, over-broad triggers), and prescribes fixes so hooks speak when relevant and stay silent otherwise. Use for "my context fills up instantly", "hooks are spamming every prompt", "dispatch hints are always wrong", "cut my token overhead", or as part of /opus-pocus. Read-only measurement first, fixes second. NOT for whether a hook's POLICY is right — volume and precision only.
In this repository20 other files it gives its agents.
- accio-rulebookSkill
- alohomoraSkill
- avada-verbosaSkill
- clarificus-maximaSkill
- configureSkill
- contradicto-revelioSkill
- descriptio-reducioSkill
- finite-recursumSkill
- legilimens-anthropicaSkill
- nihil-revelioSkill
- obliviate-fossiliumSkill
- opus-pocusSkill
- priori-incantatoSkill
- protegoSkill
- quietus-capslockiusSkill
- sorting-hatSkill
- tempus-mutaturSkill
- the-pensieveSkill
- the-remembrallSkill
- the-room-of-requirementSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Every hook that injects additionalContext charges every prompt.
- Very specific: line 19
Every hook script that emits additionalContext, systemMessage, or stdout the model sees
≈ “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
✨ Muffliato Hookus
"Your hooks talk too much. 81% of the noise is one guy."
Every hook that injects additionalContext charges every prompt. Individually reasonable
hooks compound into thousands of tokens of standing overhead — and the noise is rarely even:
in one measured repo, a single keyword-matching dispatch hint accounted for ~81% of all
injection, much of it false-positive matches (a regex for \bai\b matching every path
containing .ai/).
What to scan
- Hook wiring in
.claude/settings*.json(which events, which matchers) - Every hook script that emits
additionalContext,systemMessage, or stdout the model sees - Recent session transcripts, if accessible — the ground truth for what actually got injected
Measurement first
Rank before fixing. Per emitter: fires per session × average bytes per fire = injection share. Transcripts give this directly (grep injected blocks by their headers and measure); without transcripts, instrument each hook to log its output size for a few sessions (→ The Pensieve). Fixing the #4 emitter while #1 stands is wand-waving.
Anti-patterns to find
- Keyword matchers with false-positive regexes. Word-boundary patterns that match paths, substrings matching unrelated terms. Symptom: the hint names an obviously wrong target.
- Every-prompt injection of once-per-session facts. Environment info, standing rules, and rosters re-injected on each prompt instead of once at SessionStart.
- Unconditional emitters. Hooks that always print something — status lines, reminders — with no relevance gate. Silence must be an output.
- Over-broad event matchers. A PostToolUse hook on
*doing work only meaningful forWrite|Edit. - Full-payload dumps. Hooks injecting whole file lists, logs, or reports where a count and a path would do; oversized payloads that should spill to a file with a one-line pointer.
- Advisory duplication. Two hooks reporting the same condition from different angles — double the tokens, and the twin re-raises what the first already reported (→ also feeds Finite Recursum spirals).
Fix prescriptions
| Finding class | Fix |
| False-positive matcher | Fix the regex against a corpus of real prompts; add negative tests (the strings it must NOT match) |
| Once-per-session facts | Move to SessionStart, or gate with a session-scoped once-flag |
| Unconditional emitter | Add the relevance gate; empty output on no-news. A status line the user wants is a UI concern — keep it out of model context |
| Over-broad matcher | Narrow the event/tool matcher in the wiring, not inside the script |
| Full-payload dump | Emit count + path; write the payload to a file the model can read on demand |
| Advisory twins | Merge, or suppress by emitter+condition so each fact is reported once |
Bounds
- Scope: hook wiring in settings files, hook scripts that emit context the model reads, and session transcripts if they are accessible. Not application source, not another plugin's hooks.
- Cap: rank every emitter (the table is the deliverable); cap prescriptions at 15, largest injection share first.
- Done when the emitter table is ranked once. Fixing the top emitters is worth more than enumerating the tail.
- Quote once, at read time; mark anything you cannot re-confirm
UNVERIFIEDrather than re-reading to check yourself. - See
skills/opus-pocus/references/casting-safety.mdfor the full rules.
Report format
The ranked emitter table (emitter · fires/session · bytes/fire · share %), the false-positive
census for matchers (sampled prompts, hit rate, wrong-hit rate), and per-emitter prescriptions.
Lead with the headline: total injection per prompt now vs projected after fixes.
SCANNED NOTHING if the repo has no hooks.
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.

