openai / openai/codex-plugin-cc

Review gate setup writes to temp dir, but Stop hook reads from persistent dir

Open
#59 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
33.3k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Bug

/codex:setup --enable-review-gate appears to succeed, but the Stop hook never enforces the gate.

Root cause

resolveStateDir() in scripts/lib/state.mjs (L29-44) picks the state directory based on CLAUDE_PLUGIN_DATA:

const pluginDataDir = process.env[PLUGIN_DATA_ENV];
const stateRoot = pluginDataDir
  ? path.join(pluginDataDir, "state")
  : FALLBACK_STATE_ROOT_DIR;  // os.tmpdir() + "codex-companion"

The setup command runs via Bash (invoked by Claude), where CLAUDE_PLUGIN_DATA is not set → writes stopReviewGate: true to the temp directory.

The Stop hook runs via Claude Code's hook system, where CLAUDE_PLUGIN_DATA is set → reads from the persistent plugin data directory, which still has the default stopReviewGate: false.

Evidence
# Temp dir (written by setup) — gate enabled
/var/folders/.../codex-companion/feat-emoji-<hash>/state.json
→ { "config": { "stopReviewGate": true } }

# Persistent dir (read by hook) — gate still disabled
~/.claude/plugins/data/codex-openai-codex/state/feat-emoji-<hash>/state.json
→ { "config": { "stopReviewGate": false } }

Suggested fix

The setup subcommand in codex-companion.mjs should resolve the persistent plugin data directory the same way hooks do. Options:

  1. Have the skill pass CLAUDE_PLUGIN_DATA as an env var when invoking the setup Bash command.
  2. Have codex-companion.mjs setup detect ~/.claude/plugins/data/codex-openai-codex/ as a fallback when CLAUDE_PLUGIN_DATA is unset.
  3. Write to both directories during setup so either reader finds the correct value.

Environment

  • Claude Code (CLI)
  • codex-plugin-cc v1.0.1
  • codex-cli 0.117.0
  • macOS Darwin 25.4.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read resolveStateDir() in scripts/lib/state.mjs and the setup subcommand in codex-companion.mjs, then compare how setup and the Stop hook obtain the state directory. Choose a consistent persistence approach from the issue's suggested options and verify that enabling the gate through setup makes the Stop hook read stopReviewGate: true.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.