Mario Alexandre  ·  March 26, 2026  ·  auto-scatter prompt-hook sinc-llm

From Blocking to Transforming: How My Prompt Hook Evolved

I want to tell you about the design mistakes I made before I got the hook right. The version that saves $1,588/week looks nothing like the one I built first. Understanding that gap is more useful than just seeing the final result.

Version 1: The Blocker

My first prompt hook was defensive. I was worried about bad prompts reaching the model. I worried about prompts with too little context. I worried about prompts that would make the model ask follow-up questions. I worried about prompts that would start expensive loops. So I built a hook that checked each prompt against a quality score and rejected the ones that scored too low.

v1 — week 1
Quality Gating / Blocking Hook
Hook scores incoming prompts on 3 dimensions (specificity, context presence, constraint clarity). If score below 0.4, rejects prompt and asks user to add more detail before retrying.
Result: annoying. I kept getting rejected on short prompts I knew were fine. Interrupts flow. Abandoned after 3 days.
v2 — week 2
Suggestion Hook
Instead of blocking, the hook suggests improvements to the prompt before sending. "Your prompt is missing constraints — want me to add some?" Requires user to confirm before proceeding.
Result: still interrupts flow. Every prompt requires an extra confirmation step. Exchange rate goes UP, not down. Abandoned after 2 days.
v3 — week 2
Auto-Transform Hook (current)
Hook intercepts every prompt, transforms it into 6-band sinc JSON via Haiku API, injects as system context — all without user involvement. Prompt passes through unchanged. Model gets structure automatically.
Result: exchange rate 4.2 → 1.6. $1,588.56 saved in 7 days. No flow interruption. Invisible.

The Insight That Changed Everything

The key insight was simple: blocking and suggesting both need the user to do something. That creates friction. Friction in a tool that runs on every single prompt is fatal. You stop using the tool. You start hating it. You find workarounds that defeat the whole point.

Transforming needs zero action from the user. The hook does its work and stays out of the way. You type what you want. You get a great response. You never think about the hook.

sinc-LLM — the prompt as a signal to be reconstructed
x(t) = Σ x(nT) · sinc((t - nT) / T)

This matches the Nyquist-Shannon theorem that I used as the basis for the sinc format. The theorem says you can perfectly rebuild a signal from its samples, as long as you sample at the right rate. The Haiku scatter call samples the prompt across all 6 frequency bands at once. The result, the sinc JSON, gives the main model more than enough information to answer correctly on the first try.

What "Non-Blocking" Really Means

Non-blocking in my system means two things. First, the hook never rejects or slows down a prompt on its way to the model. Second, if the hook itself breaks, if the Haiku API is down, or if the scatter call times out after 25 seconds, the original prompt still goes through unchanged. The hook falls back to doing nothing.

I added a fallback for that case. If the API fails, the hook runs a template-based scatter using keyword guessing. It is not as good as Haiku, more generic and less context-aware, but it is far better than no scatter at all. SNR goes from 0.003 on a raw prompt to about 0.4 with template scatter, versus 0.855 with Haiku scatter. That is still a big improvement, even in degraded mode.

The Edge Cases I Had to Handle

Three types of input skip the transform completely:

Already sinc JSON: if the input is already a valid 6-band sinc structure, pass it through. Do not scatter it twice. The sinc format is the contract between agents. Scattering it again breaks it.

@agent mentions: if the prompt starts with @, it is routing to a named agent. Do not intercept it. Send it directly. The routing is part of the system design. The scatter hook should not touch it.

/slash commands: same idea. Slash commands are infrastructure instructions, not natural language prompts. Pass them through unchanged.

Everything else gets scattered. One-word prompt: scatter it. "hi": scatter it. A 500-word specification: scatter it. There is no minimum length, no complexity threshold, no shortcut. Every natural language prompt reaches the model with structured sinc context.

// Production AI Engineering

Build AI systems that hold up in production.

sinc-LLM designs, audits, and stabilises production AI infrastructure: from vendor evaluation and cost accountability to incident controls and MCP architecture.

See what we do →