Repository navigation
Description
Deferred out of #407 with a stated reason, and now unblocked as the next piece of Codex work. #406 is the epic.
The gap
pipeline/host.py reads the transcript path the host hands over, and scripts/resolve-paths.sh reads the plugin root under either name. The third field on the same payload -- cwd -- is still unused, so the project root is resolved from CLAUDE_PROJECT_DIR and from nothing else.
That variable is set by Claude Code. Codex does not set it, and Gemini CLI documents no environment variables for command hooks at all. So on any host but the one this plugin grew up on, resolve-paths.sh:121 finds nothing, the .claude/remember layout branch below it does not match a marketplace install, and resolution fails outright. Every hook then takes its || exit 0 and the plugin is silently inert.
This is the last resolution seam still reachable only through a Claude-specific variable.
Why it was deferred, and what has to be handled
scripts/session-start-hook.sh:75 sources resolve-paths.sh. HOOK_STDIN is not captured until line 124. The resolver runs before stdin has been read, so it cannot consult a field that has not arrived.
Neither obvious escape is free:
- The resolver reads stdin itself. No. stdin is single-read, and three hooks plus non-hook callers source that file. It would consume the payload out from under the
session_id(False "previous session was not captured" warning fires on every /clear #206) andsource(session-start-hook.sh ignores thesourcefield, re-injecting the full memory recap on everycompact#339) extraction that already depends on it. - Hoist the capture above the source line. This is the route, but it has a cost that must be paid deliberately rather than discovered later: the bounded
read -t 1would then run before theREMEMBER_NESTED_SUMMARIZERguard atresolve-paths.sh:68. Every nestedclaude -psummarizer child would pay up to a second at startup before discovering it has no project. The guard is an environment test and can be applied to the capture directly, but it has to be applied.
The judgement this needs
Where the nested-summarizer guard goes, and whether the hoist is the right shape at all. The obvious answer -- guard the capture with the same REMEMBER_NESTED_SUMMARIZER test -- duplicates a condition that currently lives in exactly one place, and this repo has a stated preference for one copy. An alternative worth weighing before writing code: have the hook capture stdin, export the fields, and source the resolver afterwards, leaving the resolver reading only the environment as it does today. That keeps the resolver stdin-free and moves nothing into it, at the cost of reordering two lines in each hook.
Whoever takes this should say which shape they chose and why, and is expected to disagree with the framing above if it is wrong.
Precedence
CLAUDE_PROJECT_DIR, then the stdin cwd, then the existing .claude/remember layout derivation, then the existing failure. A stdin cwd that disagrees with a set CLAUDE_PROJECT_DIR must not silently win -- the environment variable is the more specific signal on the host that sets it.
What this cannot establish
No Codex or Gemini binary is installed on the maintainer's machine. A test can unset CLAUDE_PROJECT_DIR and supply cwd on stdin, and that is a real test of the precedence chain -- but it simulates the host rather than exercising one. The nested-summarizer startup cost, by contrast, is measurable here and should be measured rather than reasoned about.
Say which claims are observed and which are reasoned. Do not describe this as verified Codex support.
Prior context
- Add official OpenAI Codex support #406 -- the Codex epic, carrying what the three hosts actually document.
- Read cwd and transcript_path from hook stdin instead of deriving them #407 (merged, b909b8f) -- the transcript-path and plugin-root halves, and
pipeline/host.py. - Codex plugin manifest and marketplace entry (scaffolding, unverified against a live host) #410 -- the Codex manifest, in flight in a separate lane. It does not touch these files.
Activity
fix: resolve-paths.sh can now find a project root without CLAUDE_PROJ…
fix: give user-prompt-hook.sh and post-tool-hook.sh the #411 stdin cw…
fix: env-cache fast path dead on Codex/Gemini; PLUGIN_ROOT accepted u…