Skip to content

feat(agents): expose plugin tool hooks to Claude and Codex - #1579

Draft
johnmatthewtennant wants to merge 7 commits into
jtennant/aaron/attention-monitorfrom
jtennant/zack/agent-hooks
Draft

johnmatthewtennant wants to merge 7 commits into
jtennant/aaron/attention-monitorfrom
jtennant/zack/agent-hooks

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Plugins can contribute agent tools, but cannot intercept calls to shell, file or other tools. They need a live callback for tool policies and completion observations without replacing an active session when plugin settings change.

What

Add agents.registerToolHook for Claude and Codex. Plugins receive the agent, session, tool input, conversation and delivered-mention snapshot. A before callback can deny a call with a reason; after callbacks observe success or failure. Registration follows plugin activation and disposal.

Claude uses SDK callbacks for native and Buzz tools. Codex uses an authenticated MCP bridge per thread start or resume for native pre-tool decisions, plus before/after callbacks for Buzz tools. Codex native transport errors fail open, so these hooks are conversational guardrails. Other native lifecycle hook events are outside this API.

Validation

Actual Claude and Codex subprocesses with fixture model responses exercised a plugin policy denying shell work until a successful public message. Failed sends retained the denial. Transport fixtures exercised independent concurrent thread startup and resume, cleanup and standalone turns. External-loader Chromium checks exercised plugin activation, settings changes and disposal. The installed Codex session demonstrated denial and successful-send unlocking without restarting that session; native Claude acceptance remains unverified.

@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
johnmatthewtennant force-pushed the jtennant/zack/agent-hooks branch from cbe4783 to 2d5d922 Compare October 23, 2026 20:31
@johnmatthewtennant johnmatthewtennant changed the title Let plugins add hooks to Claude and Codex feat(agents): expose plugin tool hooks to Claude and Codex Oct 23, 2026
@johnmatthewtennant
johnmatthewtennant changed the base branch from main to jtennant/aaron/attention-monitor October 23, 2026 20:31
@johnmatthewtennant
johnmatthewtennant force-pushed the jtennant/aaron/attention-monitor branch from 8e9ab70 to f11445f Compare October 23, 2026 21:03
johnmatthewtennant and others added 7 commits October 23, 2026 17:04
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>
Co-authored-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Zack authored the implementation and tests in 1b75369. This adds the omitted agent credit without amending that commit.

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