Skip to content

fix(init): install Codex global instructions in CODEX_HOME - #1096

Merged
aeppling merged 1 commit into
rtk-ai:developfrom
michaelschleiss:fix/codex-home-init-path
Apr 10, 2026
Merged

aeppling merged 1 commit into
rtk-ai:developfrom
michaelschleiss:fix/codex-home-init-path

Conversation

@michaelschleiss

@michaelschleiss michaelschleiss commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make rtk init -g --codex respect CODEX_HOME when it is set, instead of always writing Codex global files to ~/.codex.

Problem

Codex can use a custom config home via CODEX_HOME, but the global Codex init flow still resolved its install location as ~/.codex. In environments where Codex is configured under a different home, rtk init -g --codex writes AGENTS.md and RTK.md to the wrong directory.

Fix

Resolve the Codex global config directory from CODEX_HOME first and fall back to ~/.codex only when it is unset. Keep uninstall and config inspection aligned with the absolute Codex RTK.md reference used by global installs, and update the hook docs and changelog to match the new behavior.

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk init -g --codex, rtk init -g --codex --uninstall, and rtk init --codex output inspected

Important: All PRs must target the develop branch (not master).
See CONTRIBUTING.md for details.

@CLAassistant

CLAassistant commented Apr 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@michaelschleiss michaelschleiss changed the title fix(init): honor CODEX_HOME for Codex global paths fix(init): install Codex global instructions in CODEX_HOME Apr 9, 2026
@michaelschleiss
michaelschleiss force-pushed the fix/codex-home-init-path branch from 99c0eae to d442799 Compare April 9, 2026 08:51
@aeppling

Copy link
Copy Markdown
Contributor

Hey @michaelschleiss

Thanks for the contribution, good for me

@aeppling
aeppling merged commit a257688 into rtk-ai:develop Apr 10, 2026
10 checks passed
@michaelschleiss
michaelschleiss deleted the fix/codex-home-init-path branch April 11, 2026 22:04
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
…it-path

fix(init): install Codex global instructions in CODEX_HOME
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
…it-path

fix(init): install Codex global instructions in CODEX_HOME
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.

3 participants