agentleFS
Totes-MickGOATsTotes-MickGOATs/opus-pocus/skills/muffliato-hookus/SKILL.md

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.

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
  1. Very specific:

    Every hook that injects additionalContext charges every prompt.

    line 10
  2. Very specific:

    Every hook script that emits additionalContext, systemMessage, or stdout the model sees

    line 19

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

✨ 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 classFix
False-positive matcherFix the regex against a corpus of real prompts; add negative tests (the strings it must NOT match)
Once-per-session factsMove to SessionStart, or gate with a session-scoped once-flag
Unconditional emitterAdd 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 matcherNarrow the event/tool matcher in the wiring, not inside the script
Full-payload dumpEmit count + path; write the payload to a file the model can read on demand
Advisory twinsMerge, 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.