Skip to content

fix: keep personal Codex hooks and AGENTS.md out of subscription runs - #22

Merged
3ae3ae merged 1 commit into
general-clifrom
wp/codex-home
Oct 19, 2026
Merged

3ae3ae merged 1 commit into
general-clifrom
wp/codex-home

Conversation

@3ae3ae

@3ae3ae 3ae3ae commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

I checked hook isolation with marker-writing hooks in a temporary config home, running each CLI against a local capture server with no model calls.

user hooks run without harness2's flags with harness2's flags
Claude Code SessionStart, UserPromptSubmit none
Codex config.toml hooks, hooks.json hooks hooks.json hooks still run

So Claude Code was already isolated, but on this machine every chatgpt-login rollout and improver session also ran the personal ~/.codex/hooks.json, which here holds Paseo integration hooks. Logging in with an access token only is not possible with this Codex version, because it accepts only an agent-identity JWT.

The fix:

  • chatgpt-login now runs Codex on a home kept for harness2, ~/.local/state/harness2/codex-home. harness2 never writes config, hooks or instructions there.
  • The new harness2 login codex signs that home in to ChatGPT once. This is a separate login: the user's ~/.codex and its refresh token are never touched.
  • providers.chatgpt-login.home can point runs at another home. doctor then reports the non-empty AGENTS.md / hooks.json that every run will include.
  • harness2 login (no argument) shows whether claude-login and chatgpt-login are ready.
  • init, the agent guide, README, configuration and cli docs, and the CHANGELOG are updated.

Test plan

  • 160 core tests pass. Offline tests cover:
    • default and configured homes, for both executor and improver
    • API-key stripping
    • doctor messages
    • no files written into the home
    • login status
  • Plugin tests and ruff pass
  • The hook isolation table above was produced by real CLI runs, without model calls
  • harness2 login codex with a real browser sign-in: needs the user

🤖 Generated with Claude Code

Codex has no flag to skip a personal ~/.codex/hooks.json or
~/.codex/AGENTS.md: with --ignore-user-config it still runs and reads
them (verified with marker-writing hooks), so every chatgpt-login
rollout and improver session fired the user's own hooks. Claude Code's
flags, by contrast, do keep user hooks and plugins out (verified the
same way).

chatgpt-login now runs Codex on a home kept for harness2,
~/.local/state/harness2/codex-home, which the user signs in to ChatGPT
once with the new `harness2 login codex`; that is a separate login, so
the user's own ~/.codex is never read or changed and its refresh token
is never used. `providers.chatgpt-login.home` points runs at another
home instead, and doctor then lists the personal files every run will
include. `harness2 login` shows whether both subscription logins are
ready, and init and the agent guide point at it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@3ae3ae
3ae3ae merged commit 9cc2c31 into general-cli Oct 19, 2026
5 checks passed
@3ae3ae
3ae3ae deleted the wp/codex-home branch October 19, 2026 13:39
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.

1 participant