Approve scripts and hooks
Skill text activates on its own; anything executable, every provisional subagent and any text for your system prompt waits for you. Approve or decline each from the session-start digest or the terminal.
What waits for you
Section titled “What waits for you”The digest shows one item per entry. Its kind joins what is pending with +, in this order:
| Kind | What it is | Shown in the diff |
|---|---|---|
scripts |
files under the entry’s scripts/ |
each file |
hook |
a kind: hook entry |
the compiled module and the pass condition |
agent |
a provisional subagent (AGENT.md) |
+++ AGENT.md and its text |
prompt |
the entry’s AGENTS.fragment.md |
+++ AGENTS.fragment.md and its text |
An entry with a script and a fragment shows as scripts+prompt. Approving it approves every pending part at once; declining retires the entry. The diff is cut at 4,096 bytes.
Approve or decline
Section titled “Approve or decline”At session start the digest asks once per entry, with the diff and the hook’s pass condition. Approving a subagent reloads it at once.
There is no dialog. The session-start digest lists each approval with its commands, which only you can run:
/rematch:rematch-approve <id>/rematch:rematch-decline <id>Codex runs no hooks. The optional $rematch-status skill runs the digest and approvals through rematch, each command after your approval.
rematch library approve <id>rematch library decline <id>| You | Result |
|---|---|
| approve a script | it becomes mode 0755 in place |
| approve a hook | it is compiled to ~/.omp/agent/extensions/rematch-hooks/<id>.ts (data only; the extension runs it) |
| approve a subagent | it is linked into ~/.rematch/agents/ (Claude Code: copied into the plugin’s agents/), visible in every session and counted where its repo matches |
| approve a fragment | the harness appends ## rematch: <name> and the text to the system prompt of main sessions where the entry loads, within the 8 KB always-on budget |
| decline | the entry is retired |
System-prompt text
Section titled “System-prompt text”- Only you can put it there. rematch never writes your
AGENTS.md; the harness appends the block to the prompt of each main session. - Bound to the text. The approval records the file’s hash. Edit the fragment (or a subagent’s body) and it is pending again.
- Disable, decline or retire removes it from the system prompt.
- Where it works. omp, Pi, OpenCode and Claude Code (through the session-start context). Codex loads skills only.
- Team
AGENTS.mdis unchanged: it still reaches a repo only through a team branch.
Hook modes
Section titled “Hook modes”| Mode | What it does |
|---|---|
block |
blocks a tool call whose input field matches a pattern, with the rule’s message |
stuck |
blocks a call identical (same tool, same arguments) to the N calls right before it; any other call in between resets it |
truncate |
in the request sent to the model (never in the session file), tool outputs older than N user turns keep their first K characters, ending …[rematch: truncated N chars, age K turns] |
retrieve |
before each request, appends one hidden message with the units of your loaded skills that match what you just asked and the files just touched, within a byte budget |
Built-in hooks
Section titled “Built-in hooks”Three hook entries ship with rematch. They appear as approvals the first time the digest runs; they live in branch shared and match every session.
| Entry | Mode | Setting |
|---|---|---|
context-unit-retrieval |
retrieve |
≤ 6000 bytes, units sharing ≥ 2 stems with the request |
tool-output-truncation |
truncate |
outputs older than 6 user turns keep 1200 characters |
stuck-detector |
stuck |
the 4th identical call in a row is blocked |
They are ordinary entries under the same counters:
- Once approved, each is counted in every session.
- Kept after four clean sessions.
- Retired after two sessions with any classed redirect, or two with harm (error cluster, takeover, disable).
- Declining retires it for good.
rematch builtins ls # status of the threerematch builtins reinstall [name] # stage a retired one againWhy executable changes wait: D4. Hook support per harness: harness capabilities.