Skip to content

Let plugins add hooks to Claude and Codex - #1579

Draft
johnmatthewtennant wants to merge 7 commits into
mainfrom
jtennant/zack/agent-hooks
Draft

johnmatthewtennant wants to merge 7 commits into
mainfrom
jtennant/zack/agent-hooks

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Plugins can add agent tools, but cannot require an acknowledgement before an agent uses shell or file tools. A reply-first plugin needs a live enforcement point without replacing the session whenever its setting changes.

What

Add agents.registerToolHook with plugin-scoped pre-tool decisions and completion observations. Claude uses SDK hook callbacks. Codex uses authenticated host MCP transports, one per thread start or resume, with trust limited to the bridge’s exact definition. Transport cleanup covers conversations, standalone wakes, compaction, background chat naming and process shutdown. Codex completion observations cover Buzz dynamic tools; Claude also observes native tool completions.

A separate reply-first plugin blocks work while a delivered mention awaits a successful public reply in its conversation. The policy and its live setting belong to that plugin. Existing sessions need a one-time restart after installing the bridge. Codex’s native hook transport fails open on transport errors, so this remains a conversational guardrail.

Validation

With fixture model responses, the actual Claude binary blocks shell work, keeps blocking after a failed send, and unlocks after a successful send. The actual Codex binary blocks shell work until a successful send. Single-use HTTP transport fixtures verify independent thread startup and resume while preserving reply-first enforcement. Runtime regressions cover overlapping conversations, background naming, interrupted wakes, compaction and shutdown during transport allocation. Standalone watch and timer tools consult policies with empty mention and destination snapshots, including denial and successful or failed Buzz completion events.

The installed host plus external reply-first plugin has not been exercised end to end.

johnmatthewtennant and others added 2 commits October 23, 2026 10:29
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
@johnmatthewtennant johnmatthewtennant changed the title feat(agents): let plugins gate tools in Claude and Codex Let plugins add hooks to Claude and Codex Oct 23, 2026
johnmatthewtennant and others added 5 commits October 23, 2026 11:19
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant