Skip to content

Research: find a repeatable path to Codex hook trust for Desktop/CLI users #52

Description

@jsirish

Context

Issue #47 closed 2026-08-25 with a "not wiring" decision: Codex hooks were found to
require a persisted trust grant with "no verified non-interactive path." That
conclusion turned out to be too pessimistic — later the same day, a real interactive
CLI session (codex -p qwen, answering Codex's ordinary "do you trust this
directory?" prompt) granted hook trust as a side effect, persisted as a
trusted_hash (content hash) in that profile's config layer
(~/.codex/qwen.config.toml's new [hooks.state] block). Verified: headless
codex --profile qwen exec then fired real hooks with zero special flags.

Since trust is a content hash, it's portable. Manually copying that same
[hooks.state] block into the base ~/.codex/config.toml — the file Codex
Desktop reads exclusively (no --profile mechanism) and bare codex (no -p flag)
also reads — made automatic capture work there too. Confirmed live, twice, in two
real projects (~/Sites/rocklineind mid-real-work, ~/Sites/dynamicagency-essentials
a clean isolated test): extensive PostToolUse/UserPromptSubmit capture, correct
redaction, no issues.

The problem

This fix only exists because one machine's specific state (a -p qwen profile
that happened to get trust-reviewed once) could be copied elsewhere. There's no
repeatable, documentable path yet for a new throughline user to get here:

  1. Does a fresh install ever get an interactive hook-review prompt at all, or did
    this only happen because of something specific to how -p qwen was invoked?
    Several already-trusted base-config projects (predating this fix) show general
    directory trust with zero hook review ever bundled in — is that because
    throughline's hooks weren't available/installed yet at the time those grants
    happened, or because Desktop/base-config's trust flow genuinely never offers hook
    review the way the CLI-under-a-profile flow did?
  2. plugin_hooks was set to true in the base config's [features] table as part
    of this fix, at the same time as the [hooks.state] copy — confounded.
    Neither ~/.codex/qwen.config.toml nor any other profile file ever had
    plugin_hooks set explicitly, yet the original interactive grant worked anyway —
    suggesting the flag may default to on for interactive/TUI use (only off for
    headless codex exec, per Wire and verify automatic capture hooks on Codex CLI (currently skills-only) #47's original finding). Isolate which of the two
    changes actually mattered for Desktop.
  3. Is hand-writing [hooks.state] entries a safe, durable thing to rely on, or does
    it bypass an intended human-review step in a way that could be considered misuse,
    break silently on a future Codex update, or get invalidated by something we don't
    understand yet about how these hashes are validated?
  4. If a genuinely fresh interactive session (never-before-opened project, base
    config, plugin_hooks on) does offer hook review on its own — what does that
    flow actually look like, and can it be turned into a documented one-time setup
    step for the README instead of a manual TOML edit?
  5. If it does not — is there a legitimate, non-hacky way to request this from
    Codex (a real CLI subcommand, a documented config key), or is the manual copy
    genuinely the only lever available right now?

What to do

Research, not implementation yet. Needs controlled, isolated tests (change one
variable at a time, unlike this session's discovery) — probably in a scratch
CODEX_HOME to avoid repeatedly mutating the real machine config. Once the actual
mechanism is understood:

  • Decide whether this becomes a documented manual setup step, a scripted one-time
    fix, or stays undocumented/unsupported
  • Revisit Wire and verify automatic capture hooks on Codex CLI (currently skills-only) #47's "not wiring" framing in the README/promo site if a real, repeatable
    path is found
  • If none of this is safe/durable enough to recommend, document that conclusion too
    so a future session doesn't have to re-derive it

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions