codex-hook-kit

Read-only doctor

node doctor.mjs --project C:/Projects/MyProject --config-dir C:/Users/me/.codex --codex C:/path/to/codex.exe --json

All flags are optional. --project defaults to the current directory. The settings directory uses --config-dir, then CODEX_HOME, then ~/.codex. Executable discovery uses --codex, then CODEX_BIN, then an executable on PATH. On Windows use a native codex.exe, rather than a .ps1, .cmd or .bat shim. A stale root alias can point to an older binary; the report names and versions the exact executable it probes. That executable is not necessarily the one used by the running Desktop app.

Without --json, the command prints a short human-readable report. JSON includes individual hook trust statuses, current hashes, API errors/warnings and invocation receipt metadata. A successfully generated report exits zero even when it reports missing prerequisites or unavailable support. Invalid command arguments exit one.

The report keeps these facts separate:

Each diagnostic child has a six-second default deadline and a 2 MiB output cap. Only that spawned child is terminated at completion or timeout. The report waits for its close event, or explicitly reports termination-pending after a one-second cleanup deadline. The doctor does not change project configuration, registrations, trust, goal state or receipt files. The Codex process may maintain its own ordinary runtime logs while serving this read-only API request. Receipt reads are bounded to 256 files of at most 64 KiB each.

Async hooks can emit delayed information; they cannot resume an idle chat. An emission receipt must never be presented as proof that Desktop displayed the result.

Capability summaries distinguish native worker lifecycle receipts, owner-lifecycle prompt receipts, and synchronous Stop invocation. Rule injection at UserPromptSubmit does not establish goal-lifecycle execution. Delayed-report emission does not count as synchronous Stop delivery. Missing receipts are reported as unverified, not as proof that a runtime can never support that feature. These summaries supplement, rather than replace, the underlying receipt metadata.