Skip to content

docs: add Codex PreToolUse adapter guide#2068

Closed
xuegaoge wants to merge 1 commit into
rtk-ai:developfrom
xuegaoge:codex/codex-hooks-adapter-doc
Closed

docs: add Codex PreToolUse adapter guide#2068
xuegaoge wants to merge 1 commit into
rtk-ai:developfrom
xuegaoge:codex/codex-hooks-adapter-doc

Conversation

@xuegaoge
Copy link
Copy Markdown

@xuegaoge xuegaoge commented May 24, 2026

Summary

  • Adds docs/usage/CODEX_PRETOOLUSE_ADAPTER.md, a focused guide for installing an optional Codex Desktop/CLI PreToolUse adapter.
  • Keeps hooks/codex/README.md as the hook-directory overview and links it to the new usage guide.
  • Provides an idempotent quick-install snippet that reuses an existing RTK install when rtk gain works, and installs RTK only when missing or incorrect.

Why

rtk init --codex currently gives Codex prompt-level awareness through AGENTS.md and RTK.md, but it does not provide a native Codex hook. The documented adapter lets Codex rewrite Bash commands at tool-call time while preserving normal pass-through behavior when RTK has no rewrite.

Validation

  • Ran git diff --check HEAD~1..HEAD.
  • Executed the quick-install snippet twice against a temporary CODEX_HOME and verified it remained idempotent with one PreToolUse entry.
  • Verified the generated hook compiles with python3 -m py_compile.
  • Simulated a Codex Bash payload and confirmed git status rewrites to rtk git status.
  • Simulated a non-Bash payload and confirmed the hook emits zero bytes.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


macos seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@xuegaoge xuegaoge force-pushed the codex/codex-hooks-adapter-doc branch from 7133be3 to 8501ab8 Compare May 24, 2026 09:45
@xuegaoge xuegaoge changed the title docs: add Codex hook adapter guide docs: add Codex PreToolUse adapter guide May 24, 2026
@xuegaoge
Copy link
Copy Markdown
Author

Closing in favor of #2069, which combines the native Codex plugin approach from #2063 with the safer tool_input-preserving behavior and user-facing setup guide from this PR.

@xuegaoge xuegaoge closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants