Repository navigation
Description
The situation
skillshare hooks sync writes Codex hooks into each Codex home's hooks.json, including account targets like codex-2. Codex won't run a user-level hook until it's been trusted, and it keeps that trust in the same home's config.toml:
[hooks.state."/home/me/.codex/hooks.json:stop:0:0"]
trusted_hash = "sha256:..."- The key is the hook's position:
<hooks.json path>:<event>:<group index>:<handler index>(hook_keyincodex-rs/hooks/src/lib.rs). - The hash is Codex's own digest of the normalized event, matcher and handler (
hook_hashincodex-rs/hooks/src/engine/discovery.rs, built onversion_for_tomlincodex-rs/config/src/fingerprint.rs). A hook whose hash doesn't match ismodified, one with no hash isuntrusted, and neither is loaded. - The only thing that writes it is the TUI's
/hooksreview screen, which asks the app-server for each hook'scurrentHash(hooks/list) and then writeshooks.state.<key>.trusted_hashthroughconfig/batchWrite(write_hook_trustsincodex-rs/tui/src/hooks_rpc.rs).
So every hook Skillshare installs or moves starts untrusted. codex exec has no review screen, so it just skips them. I hit this with a Stop hook synced into two Codex homes: it never fired under codex exec until I either passed --dangerously-bypass-hook-trust or opened /hooks in each home and trusted it by hand.
Codex 0.167.0, Skillshare 0.30.1. Source refs are at openai/codex 36e074a.
What works today, and why it is not enough
- Open
/hooksin the TUI for every Codex home after every sync that adds or moves a hook. That's one interactive step per home per change, and a headless box never gets it. --dangerously-bypass-hook-truston every run turns trust off for every hook, not just the ones I approved in Skillshare.- I wrote a small script that does what the TUI does:
hooks/list, thenconfig/batchWritefor the matching hooks. It works, but it has to be rerun after every sync, matches hooks by command text instead of by what Skillshare owns, and leaves stale trust behind when a hook moves or goes away.
The docs say sync never changes native trust, and I think that's the right default. The gap is that there's no way to opt in after I've already reviewed the hook in Skillshare.
Ask
An opt-in flag on skillshare hooks sync (global mode) that, after writing, records Codex trust for the hooks Skillshare owns in each Codex home it wrote:
- Get the hash from Codex itself, through the same app-server calls the TUI uses, so it always matches what Codex computes. No hand-rolled hash.
- Write only
trusted_hash, like the TUI. Leaveenabledand everything else inconfig.tomlalone, and say when Codex has a Skillshare hook disabled. - When a hook moves or is removed, clear the trust Skillshare wrote for its old position, and only if it still holds the hash Skillshare wrote.
- If
codexisn't onPATH, the hooks files are still written and the command says trust wasn't recorded.
Out of scope: project-level Codex hooks, other Agents' trust, and any change to the default.
I have a draft PR ready.
Activity
runkids commentedon Nov 10, 2026
Thanks for writing this up so carefully, and for the PR. The source references made the Codex side easy to follow.
Nothing is decided yet, but here is where my thinking is.
The gap is real. A hook that syncs fine and then never fires under
codex execis a bad surprise, and opt-in with the default unchanged feels like the right shape.What I am unsure about is doing the write and the trust in one step. Codex's review exists so a person sees the command before it runs. Entries can reach
config.yamlwithout being typed by the user, for example throughhooks import --from codextaking over registrations already inhooks.json, or an agent editing the config. With--trustin an alias, those get trusted unseen.So I am leaning toward showing which hooks would be newly trusted, with their commands, and asking before writing, plus an explicit way to skip the prompt for headless use.
Two questions. Would a confirmation step with a skip flag still fit your headless setup? And do you need trust on every sync, or mostly after adding or moving a hook?
salmonumbrella commentedon Nov 12, 2026
A confirmation step fits the headless setup as long as there is an explicit way to skip it after reviewing the commands. Showing the newly trusted hooks and their commands would make that review useful.
Trust is needed after adding a hook, changing its command, or moving it to a different position or Codex home. Unchanged syncs do not need a new approval. Unattended jobs should still be able to run the opt-in step idempotently: matching trust is reported as unchanged, and stale trust written by Skillshare is cleared when needed.
The current #829 implementation still has the explicit
--trustflag without an interactive confirmation. Your proposed confirmation and headless-skip interface remains a design discussion; I have not treated it as approved. The current follow-up fixes the reported ownership and symlink regressions.runkids commentedon Nov 15, 2026
Thanks for answering both questions. Here is the decision.
hooks sync --truststays opt-in, and the default stays unchanged. Before it writes anything, it lists the hooks it would newly trust, including ones whose command changed, with their commands, and asks once. Hooks whose trust already matches are reported as unchanged and need no answer; if nothing needs new trust, it does not ask.--yes(-y) skips the question, as it does forinstallandaudit. Without a terminal and without--yes, it trusts nothing: it lists the hooks and exits with an error that names--yes. Unlikeaudit, a missing terminal is not consent here, because the point of Codex's review is that a person sees the command before it runs.Clearing stale trust that skillshare wrote earlier needs no confirmation, since it only removes trust.
I'm adding the
approvedlabel for this shape. The implementation can continue in #829.feat(hooks): confirm Codex trust before recording it and drop the rec…
feat(ui): trust Codex hooks from the Hooks page
test(ui): cover the Codex trust dialog's refused, empty and disabled …
fix(hooks): leave out a Codex home that cannot be listed instead of s…
fix(hooks): check the reviewed Codex hooks per home when recording trust
feat(hooks): record Codex hook trust on sync with --trust (#829)