Repository navigation
feat: run under Codex, Gemini CLI and Cursor, not only Claude Code - #88
Merged
Merged
Conversation
workbench's core was already agent-neutral; its edges were not. Skills
called ${CLAUDE_PLUGIN_ROOT}/lib/wb.py, which only Claude Code
substitutes, the hooks spoke only Claude Code's protocol, and wb run
could only start claude -p (WB-61).
Skills now call wb, falling back to lib/wb.py relative to the skill.
The scope guard decides once in hooks.py and each agent's payload and
answer shape lives in hook_agents.py: Codex's apply_patch is checked
path by path, Gemini denies with decision: deny, Cursor with
permission: deny. Claude Code's hook output is unchanged.
wb run --agent (or run.agent) picks claude-code, codex, gemini or
cursor, claude-code by default, and normalises each report into the
same run.json keys. wb hooks install gemini|cursor proposes the
project hook config and merges it with --write. A Codex plugin
manifest and marketplace ship alongside the Claude Code one, with its
own hooks/codex.json so Codex never loads the Claude-format file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
workbench's skills, scope guard and headless runner now work under Claude Code, OpenAI Codex, Gemini CLI and Cursor. Claude Code behaviour is unchanged.
Why
WB-61. The CLI core was already agent-neutral, but its edges were not: skills called
${CLAUDE_PLUGIN_ROOT}/lib/wb.py, which only Claude Code substitutes; the hooks spoke only Claude Code's protocol;wb runcould only startclaude -p.How
wb, falling back to../../lib/wb.pyrelative to the skill. Claude Code already puts the plugin'sbin/on its shell's PATH, so nothing changes there. Kept to one line so no skill grows past the 80-line cap.hooks.py(guard_edit,check_stop, paths in, reason out).hook_agents.pyholds each agent's payload reading and answer shape. The Claude Code path still goes through the oldpre_tool_use/stop, so its JSON is byte-identical andhooks/hooks.jsonis untouched.hooks/codex.json, named explicitly in.codex-plugin/plugin.json: Codex loadshooks/hooks.jsonwhen a manifest names no hooks, and that file is Claude's.apply_patchis checked path by path, resolved against the session'scwd; a patch touching one unplanned file is refused whole.hooks/hooks.json. Gemini and Cursor get skills from.agents/skills/and hooks fromwb hooks install gemini|cursor, which proposes first, merges only with--write, keeps foreign keys, and replaces its own entries on a rerun.permission: deny. It refuses a tool call whose hook answer is off-schema, so on an internal error its adapter prints nothing and reports on stderr. Its stop cannot block, so"hooks": "strict"sends onefollowup_message.wb run --agent/run.agent,claude-codeby default. Each report is normalised to the samerun.jsonkeys. Claude-only flags (--permission-mode,--plugin-dir,--setting-sources) are not handed to other agents.Verification
wb impl verify WB-61, verdict pass, bound to the committed tree:python -m unittest discover -s tests -q: exit 0 (1245 tests)python -m ruff check lib: exit 0python -m mypy: exit 0Self-review (
.workflow/WB-61/review.md) found one medium issue, fixed before commit: Codex patch paths were resolved against the repo root rather than the session's directory. Its regression test fails without the fix.None of the three new agents is installed on the machine that ran this, so their adapters are tested against their documented formats, not against live sessions.
Risk and rollback
No critical zone touched. Rollback: revert the commit. Claude Code users see no change during or after. Gemini/Cursor configs written by
wb hooks installwould then call awb_hook.pythat ignores--agentand fails open, so nothing blocks.Open questions
Writetool input; the adapter readsfile_path, thenpath, and allows the edit if neither is there. Confirm on a real session before release.stats.models.*.tokenssubfields are not fully documented; usage sums whatever numeric fields it carries, cost stays empty.wbon PATH is the primary route for that reason..codex-plugin/plugin.jsonuses the compatibility location; Codex docs now prefer a rootplugin.jsonwith anextensions.com.openaiblock.bench/stays Claude-only by design: it measures workbench against plain Claude Code.