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-po...
Scanned 9/6/2026
Install to Claude Code
npx -y skills add Totes-MickGOATs/opus-pocus --skill muffliato-hookus --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Muffliato Hookus?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/totes-mickgoats-muffliato-hookus)More formats (shields.io, HTML) on the badges page.
---
name: muffliato-hookus
description: 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.
---
# ✨ 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
1. **Keyword matchers with false-positive regexes.** Word-boundary patterns that match paths,
substrings matching unrelated terms. Symptom: the hint names an obviously wrong target.
2. **Every-prompt injection of once-per-session facts.** Environment info, standing rules, and
rosters re-injected on each prompt instead of once at SessionStart.
3. **Unconditional emitters.** Hooks that always print something — status lines, reminders —
with no relevance gate. Silence must be an output.
4. **Over-broad event matchers.** A PostToolUse hook on `*` doing work only meaningful for
`Write|Edit`.
5. **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.
6. **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 `UNVERIFIED` rather than re-reading to check yourself.
- See `skills/opus-pocus/references/casting-safety.md` for 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.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!