feat: add Codex Desktop hook tracking - #27
Conversation
|
Thanks for this, it's good work. The merging and uninstall behavior line up with how the claude hooks installer does it, and the /hooks trust step is a nice catch. A few things before I merge. Which Codex builds did you test on (desktop + CLI)? I want to put a minimum version in the README. Can you paste a sample session_id from a real codex payload? hook.ts throws away anything that isn't a UUID, so if codex ids are some other format the whole thing silently does nothing. The process.exit(0) -> process.exitCode = 0 swap in cli.ts worries me because it also changes the claude path. That exit was deliberate, a hook process should die the moment its work is done, and a leftover keep-alive socket can keep it alive otherwise. If you only needed it to flush the {} response, One design change, and this is my call rather than a fault in the PR: I don't want a separate Last thing, Windows: codex has commandWindows because quoting is different there, so this probably breaks on it. A tested-on-macOS/Linux note in the README is enough for now. |
vibe hooks install now covers claude and codex in one go, gated on which apps are actually present, mirroring how vibe init wraps every tool. Drops the [tool] argument. Restores process.exit(0) in __hook, flushing the codex Stop response via the write callback, so a hook process can never outlive its work. README: fold the codex section into Desktop apps, note the codex minimum version and macOS/Linux support.
|
Went ahead and pushed the remaining changes myself since people have been asking for codex support. What changed on top of your commit:
Also confirmed the session id question myself: codex session files on disk use UUIDv7 ids, so the UUID check in hook.ts is fine as is. Build and all 17 tests pass, smoke tested install/uninstall against a scratch home. This will go out with the next release. Thanks again for the PR, it was a good base. |
init's contract is one command and you're tracked, so it now runs the presence-gated desktop hook install after the shell wrapper, silently skipping apps that aren't installed. Re-running init retrofits desktop hooks for existing users. vibe uninstall mirrors it and removes desktop hooks too; vibe hooks install/uninstall stay for doing desktop alone.
|
One more on top: vibe init now runs the desktop hook install too (silently skipping apps that aren't present), and vibe uninstall removes desktop hooks as well. init should do the whole job. The hooks subcommands stay for doing desktop alone. |
Summary
Adds first-class Codex Desktop tracking through Codex lifecycle hooks.
The existing shell wrapper tracks the
codexterminal command, but cannot see sessions started directly in the Codex Desktop app. Users can now enable Desktop tracking with:The existing
vibe hooks installbehavior remains unchanged and continues to default to Claude Code Desktop.Changes
~/.codex/hooks.jsonSessionStart,UserPromptSubmit,PostToolUse,Stop, andSessionEndinto the existing hook session enginetool: "codex"StophooksSessionEndtimeout supported by Codexvibe hooks uninstall codexUsers review and trust the generated configuration through
/hooks, then open a fresh Codex Desktop session.Privacy
The integration reads only the session ID and working directory from the Codex hook payload. It does not read prompts, transcripts, model responses, or source-file contents.
Git scoring and opt-in leaderboard submission behavior are unchanged.
Testing
npm test— 17 tests passingnpm run buildnpm pack --dry-runhooks.jsonis not overwrittencodextool labelclaudeStophook returns valid JSON