Skip to content

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

Open
michaelschleiss wants to merge 1 commit intortk-ai:developfrom
michaelschleiss:fix/codex-home-init-path
Open

fix(init): install Codex global instructions in CODEX_HOME#1096
michaelschleiss wants to merge 1 commit intortk-ai:developfrom
michaelschleiss:fix/codex-home-init-path

Conversation

@michaelschleiss
Copy link
Copy Markdown

@michaelschleiss michaelschleiss commented Apr 9, 2026

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
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

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
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