Skip to the content.

JIT-Reminder via Hooks as Recency Strategy

Static instruction placement (system prompt, AGENTS.md) anchors behavior via primacy. But high-frequency rules that are still violated need recency reinforcement — content at the end of the context, right before generation.

The Pattern

Use agent runtime hooks to block incorrect tool calls and inject a targeted reminder as the block reason. The block reason appears as the last tool response in conversation history — the recency zone.

User: "hey setup crc monitoring"
  ↓
Hook: detect-hey.sh → flag SET (unmatched signal)
  ↓
Model tries: shell("crc setup...")
  ↓
Hook: enforce-hey.sh → BLOCK
  → Block reason: "Follow Signal Dispatch rule: first tool call
    MUST be search_nodes. You CAN and SHOULD call search_nodes now."
  ↓
Model reads block reason (recency zone) → calls search_nodes

Properties

Property Value
Injection position Recency zone (last content before generation)
Targeting Contextual — only fires when the specific rule is violated
Token cost 3–5 lines when active, 0 when not triggered
Enforcement level Deterministic trigger, not deterministic compliance — the hook reliably blocks once; what the model does next is still up to the model (see Fail-Open Hook Design)
Graceful degradation One-shot — flag cleared inside the blocking hook after the first block, so the session can never lock

Comparison with Static Approaches

Approach Position Always present? Token cost Enforcement
System prompt rule Primacy Yes Every turn Prose only
MOIM / persistent instruction Recency (per-turn <turn-context>, see MOIM reality) Yes Every turn Prose only
AGENTS.md rule Primacy Yes Every turn Prose only
JIT-Reminder (hook) Recency Only when violated On violation only Deterministic

Implementation

AgentFS v7 implements this via the signal-dispatch plugin:

Harvested From

Project Source Entry
context-eng Session: Context Landscape Analysis Discovery that MOIM has no recency advantage; hook-based reminders achieve actual recency placement
agentfs-kgm-skill-dispatch MEMORY.md KGM dispatch enforcement architecture

Implications

Corrected

2026-11-19: “Enforcement level: Deterministic” overstated the pattern (the trigger is deterministic, compliance is not), and the comparison table placed MOIM at primacy, contradicting MOIM reality (recency).