openai / openai/codex-plugin-cc

Stop hook flashes a visible console window on Windows at every turn end — consider not registering it while stopReviewGate is disabled

Open
#441 0 comments 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

Summary

On Windows, after installing the plugin, a console window flashes at the end of every Claude Code turn. Differential testing traced it to the plugin's Stop hook (scripts/stop-review-gate-hook.mjs), which hooks/hooks.json registers unconditionally — even though stopReviewGate defaults to false, making the hook a no-op that still costs a node process spawn (and a visible window flash) on every turn end.

Evidence

Process-creation monitor (300ms polling) on Windows 11, Claude Code 2.1.200, plugin v1.0.5:

  • Every turn end spawns the plugin hook: bash.exe -c "node .../stop-review-gate-hook.mjs" plus a conhost.exe.
  • Differential: user-defined Stop hooks from settings.json (pwsh scripts, same spawn mechanism, running for 2 weeks / ~200 turn ends a day) do not produce a visible flash; the flashing started the day the plugin was installed and stopped immediately after removing the Stop block from the plugin's cached hooks.json (verified over multiple turns with the monitor still recording — the settings.json hooks kept firing, no flash).

Suggested fix

Since the stop-review gate is opt-in and defaults to off, consider one of:

  1. Not registering the Stop hook statically in hooks.json; register/enable it only when the user enables stopReviewGate (if the hooks API allows), or
  2. Documenting that Windows users who keep the gate disabled can remove the Stop block from hooks.json to avoid the per-turn flash and process spawn.

The window-flash mechanics may partly live in Claude Code's hook runner (cf. anthropics/claude-code#19012), but the plugin can avoid the cost entirely for the default-off configuration.

Environment

  • codex plugin v1.0.5 (commit 80c31f9), Claude Code 2.1.200
  • Windows 11, Node.js v24.16.0, Git Bash as hook shell

Related: #440 (missing windowsHide in spawnBrokerProcess() — a different spawn site, filed separately).

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 hooks/hooks.json and scripts/stop-review-gate-hook.mjs first, then trace how stopReviewGate is configured and whether hook registration can depend on it. Reproduce the Windows turn-end behavior with the gate disabled and enabled. Done means the disabled default no longer causes the Stop hook process or visible flash, while the gate remains available when enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.